(function(b){b.color={};b.color.make=function(a,d,g,e){var c={};return c.r=a||0,c.g=d||0,c.b=g||0,c.a=null!=e?e:1,c.add=function(b,a){for(var d=0;d<b.length;++d)c[b.charAt(d)]+=a;return c.normalize()},c.scale=function(b,a){for(var d=0;d<b.length;++d)c[b.charAt(d)]*=a;return c.normalize()},c.toString=function(){return 1<=c.a?"rgb("+[c.r,c.g,c.b].join()+")":"rgba("+[c.r,c.g,c.b,c.a].join()+")"},c.normalize=function(){function b(a,d,g){return d<a?a:d>g?g:d}return c.r=b(0,parseInt(c.r),255),c.g=b(0,parseInt(c.g),
255),c.b=b(0,parseInt(c.b),255),c.a=b(0,c.a,1),c},c.clone=function(){return b.color.make(c.r,c.b,c.g,c.a)},c.normalize()};b.color.extract=function(a,d){var g;do{g=a.css(d).toLowerCase();if(""!=g&&"transparent"!=g)break;a=a.parent()}while(!b.nodeName(a.get(0),"body"));return"rgba(0, 0, 0, 0)"==g&&(g="transparent"),b.color.parse(g)};b.color.parse=function(a){var d,g=b.color.make;if(d=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(a))return g(parseInt(d[1],10),parseInt(d[2],10),
parseInt(d[3],10));if(d=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(a))return g(parseInt(d[1],10),parseInt(d[2],10),parseInt(d[3],10),parseFloat(d[4]));if(d=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(a))return g(2.55*parseFloat(d[1]),2.55*parseFloat(d[2]),2.55*parseFloat(d[3]));if(d=/rgba\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(a))return g(2.55*
parseFloat(d[1]),2.55*parseFloat(d[2]),2.55*parseFloat(d[3]),parseFloat(d[4]));if(d=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(a))return g(parseInt(d[1],16),parseInt(d[2],16),parseInt(d[3],16));if(d=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(a))return g(parseInt(d[1]+d[1],16),parseInt(d[2]+d[2],16),parseInt(d[3]+d[3],16));a=b.trim(a).toLowerCase();return"transparent"==a?g(255,255,255,0):(d=c[a]||[0,0,0],g(d[0],d[1],d[2]))};var c={aqua:[0,255,255],azure:[240,255,255],beige:[245,
245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,
144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0]}})(jQuery);
(function(b){function c(a,d){var c=d.children("."+a)[0];if(null==c&&(c=document.createElement("canvas"),c.className=a,b(c).css({direction:"ltr",position:"absolute",left:0,top:0}).appendTo(d),!c.getContext)){if(!window.G_vmlCanvasManager)throw Error("Canvas is not available. If you're using IE with a fall-back such as Excanvas, then there's either a mistake in your conditional include, or the page has no DOCTYPE and is rendering in Quirks Mode.");c=window.G_vmlCanvasManager.initElement(c)}this.element=
c;c=this.context=c.getContext("2d");this.pixelRatio=(window.devicePixelRatio||1)/(c.webkitBackingStorePixelRatio||c.mozBackingStorePixelRatio||c.msBackingStorePixelRatio||c.oBackingStorePixelRatio||c.backingStorePixelRatio||1);this.resize(d.width(),d.height());this.textContainer=null;this.text={};this._textCache={}}function a(a,d,f,h){function l(a,b){b=[u].concat(b);for(var d=0;d<a.length;++d)a[d].apply(this,b)}function k(a){for(var d=[],g=0;g<a.length;++g){var c=b.extend(!0,{},v.series);null!=a[g].data?
(c.data=a[g].data,delete a[g].data,b.extend(!0,c,a[g]),a[g].data=c.data):c.data=a[g];d.push(c)}I=d;g=I.length;d=-1;for(a=0;a<I.length;++a)c=I[a].color,null!=c&&(g--,"number"==typeof c&&c>d&&(d=c));g<=d&&(g=d+1);var d=[],e=v.colors,u=e.length,f=0;for(a=0;a<g;a++)c=b.color.parse(e[a%u]||"#666"),0==a%u&&a&&(0<=f?.5>f?f=-f-.2:f=0:f=-f),d[a]=c.scale("rgb",1+f);for(a=g=0;a<I.length;++a){c=I[a];null==c.color?(c.color=d[g].toString(),++g):"number"==typeof c.color&&(c.color=d[c.color].toString());if(null==
c.lines.show){var m,e=!0;for(m in c)if(c[m]&&c[m].show){e=!1;break}e&&(c.lines.show=!0)}null==c.lines.zero&&(c.lines.zero=!!c.lines.fill);c.xaxis=p(P,n(c,"x"));c.yaxis=p(S,n(c,"y"))}q()}function n(a,b){var d=a[b+"axis"];return"object"==typeof d&&(d=d.n),"number"!=typeof d&&(d=1),d}function x(){return b.grep(P.concat(S),function(a){return a})}function m(a){var b={},d,c;for(d=0;d<P.length;++d)(c=P[d])&&c.used&&(b["x"+c.n]=c.c2p(a.left));for(d=0;d<S.length;++d)(c=S[d])&&c.used&&(b["y"+c.n]=c.c2p(a.top));
return void 0!==b.x1&&(b.x=b.x1),void 0!==b.y1&&(b.y=b.y1),b}function p(a,d){return a[d-1]||(a[d-1]={n:d,direction:a==P?"x":"y",options:b.extend(!0,{},a==P?v.xaxis:v.yaxis)}),a[d-1]}function q(){function a(b,d,c){d<b.datamin&&d!=-g&&(b.datamin=d);c>b.datamax&&c!=g&&(b.datamax=c)}var d=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,g=Number.MAX_VALUE,e,u,f,m,r,p,h,q,k,E,D,n;b.each(x(),function(a,b){b.datamin=d;b.datamax=c;b.used=!1});for(e=0;e<I.length;++e)r=I[e],r.datapoints={points:[]},l(M.processRawData,
[r,r.data,r.datapoints]);for(e=0;e<I.length;++e){r=I[e];D=r.data;n=r.datapoints.format;if(!n){n=[];n.push({x:!0,number:!0,required:!0});n.push({y:!0,number:!0,required:!0});if(r.bars.show||r.lines.show&&r.lines.fill)n.push({y:!0,number:!0,required:!1,defaultValue:0,autoscale:!!(r.bars.show&&r.bars.zero||r.lines.show&&r.lines.zero)}),r.bars.horizontal&&(delete n[n.length-1].y,n[n.length-1].x=!0);r.datapoints.format=n}if(null==r.datapoints.pointsize){r.datapoints.pointsize=n.length;h=r.datapoints.pointsize;
p=r.datapoints.points;var z=r.lines.show&&r.lines.steps;r.xaxis.used=r.yaxis.used=!0;for(u=f=0;u<D.length;++u,f+=h){E=D[u];var J=null==E;if(!J)for(m=0;m<h;++m)q=E[m],(k=n[m])&&(k.number&&null!=q&&(q=+q,isNaN(q)?q=null:Infinity==q?q=g:-Infinity==q&&(q=-g)),null==q&&(k.required&&(J=!0),null!=k.defaultValue&&(q=k.defaultValue))),p[f+m]=q;if(J)for(m=0;m<h;++m)q=p[f+m],null!=q&&(k=n[m],k.autoscale&&(k.x&&a(r.xaxis,q,q),k.y&&a(r.yaxis,q,q))),p[f+m]=null;else if(z&&0<f&&null!=p[f-h]&&p[f-h]!=p[f]&&p[f-h+
1]!=p[f+1]){for(m=0;m<h;++m)p[f+h+m]=p[f+m];p[f+1]=p[f-h+1];f+=h}}}}for(e=0;e<I.length;++e)r=I[e],l(M.processDatapoints,[r,r.datapoints]);for(e=0;e<I.length;++e){r=I[e];p=r.datapoints.points;h=r.datapoints.pointsize;n=r.datapoints.format;E=f=d;z=D=c;for(u=0;u<p.length;u+=h)if(null!=p[u])for(m=0;m<h;++m)q=p[u+m],(k=n[m])&&!1!==k.autoscale&&q!=g&&q!=-g&&(k.x&&(q<f&&(f=q),q>D&&(D=q)),k.y&&(q<E&&(E=q),q>z&&(z=q)));if(r.bars.show){switch(r.bars.align){case "left":u=0;break;case "right":u=-r.bars.barWidth;
break;case "center":u=-r.bars.barWidth/2;break;default:throw Error("Invalid bar alignment: "+r.bars.align);}r.bars.horizontal?(E+=u,z+=u+r.bars.barWidth):(f+=u,D+=u+r.bars.barWidth)}a(r.xaxis,f,D);a(r.yaxis,E,z)}b.each(x(),function(a,b){b.datamin==d&&(b.datamin=null);b.datamax==c&&(b.datamax=null)})}function D(a){function b(a){return a}var d,c,g=a.options.transform||b,e=a.options.inverseTransform;"x"==a.direction?(d=a.scale=T/Math.abs(g(a.max)-g(a.min)),c=Math.min(g(a.max),g(a.min))):(d=a.scale=R/
Math.abs(g(a.max)-g(a.min)),d=-d,c=Math.max(g(a.max),g(a.min)));g==b?a.p2c=function(a){return(a-c)*d}:a.p2c=function(a){return(g(a)-c)*d};e?a.c2p=function(a){return e(c+a/d)}:a.c2p=function(a){return c+a/d}}function H(a){var d=a.labelWidth,c=a.labelHeight,g=a.options.position,e=a.options.tickLength,u=v.grid.axisMargin,f=v.grid.labelMargin,m="x"==a.direction?P:S,r,p=b.grep(m,function(a){return a&&a.options.position==g&&a.reserveSpace});b.inArray(a,p)==p.length-1&&(u=0);null==e&&(m=b.grep(m,function(a){return a&&
a.reserveSpace}),(r=0==b.inArray(a,m))?e="full":e=5);isNaN(+e)||(f+=+e);"x"==a.direction?(c+=f,"bottom"==g?(C.bottom+=c+u,a.box={top:N.height-C.bottom,height:c}):(a.box={top:C.top+u,height:c},C.top+=c+u)):(d+=f,"left"==g?(a.box={left:C.left+u,width:d},C.left+=d+u):(C.right+=d+u,a.box={left:N.width-C.right,width:d}));a.position=g;a.tickLength=e;a.box.padding=f;a.innermost=r}function J(){var a=v.grid.minBorderMargin,d={x:0,y:0},c;if(null==a)for(c=a=0;c<I.length;++c)a=Math.max(a,2*(I[c].points.radius+
I[c].points.lineWidth/2));d.x=d.y=Math.ceil(a);b.each(x(),function(a,b){var c=b.direction;b.reserveSpace&&(d[c]=Math.ceil(Math.max(d[c],("x"==c?b.labelWidth:b.labelHeight)/2)))});C.left=Math.max(d.x,C.left);C.right=Math.max(d.x,C.right);C.top=Math.max(d.y,C.top);C.bottom=Math.max(d.y,C.bottom)}function L(){var a,d=x(),c=v.grid.show;for(a in C){var g=v.grid.margin||0;C[a]="number"==typeof g?g:g[a]||0}l(M.processOffset,[C]);for(a in C)"object"==typeof v.grid.borderWidth?C[a]+=c?v.grid.borderWidth[a]:
0:C[a]+=c?v.grid.borderWidth:0;b.each(d,function(a,b){b.show=b.options.show;null==b.show&&(b.show=b.used);b.reserveSpace=b.show||b.options.reserveSpace;var d=b.options,c=+(null!=d.min?d.min:b.datamin),g=+(null!=d.max?d.max:b.datamax),e=g-c;if(0==e){if(e=0==g?1:.01,null==d.min&&(c-=e),null==d.max||null!=d.min)g+=e}else{var u=d.autoscaleMargin;null!=u&&(null==d.min&&(c-=e*u,0>c&&null!=b.datamin&&0<=b.datamin&&(c=0)),null==d.max&&(g+=e*u,0<g&&null!=b.datamax&&0>=b.datamax&&(g=0)))}b.min=c;b.max=g});
if(c){g=b.grep(d,function(a){return a.reserveSpace});b.each(g,function(a,d){z(d);var c=d.options.ticks,g=[];null==c||"number"==typeof c&&0<c?g=d.tickGenerator(d):c&&(b.isFunction(c)?g=c(d):g=c);var e;d.ticks=[];for(c=0;c<g.length;++c){var u=null,f=g[c];"object"==typeof f?(e=+f[0],1<f.length&&(u=f[1])):e=+f;null==u&&(u=d.tickFormatter(e,d));isNaN(e)||d.ticks.push({v:e,label:u})}g=d.ticks;d.options.autoscaleMargin&&0<g.length&&(null==d.options.min&&(d.min=Math.min(d.min,g[0].v)),null==d.options.max&&
1<g.length&&(d.max=Math.max(d.max,g[g.length-1].v)));g=d.options;e=d.ticks||[];c=g.labelWidth||0;u=g.labelHeight||0;f=c||"x"==d.direction?Math.floor(N.width/(e.length||1)):null;legacyStyles=d.direction+"Axis "+d.direction+d.n+"Axis";layer="flot-"+d.direction+"-axis flot-"+d.direction+d.n+"-axis "+legacyStyles;font=g.font||"flot-tick-label tickLabel";for(var m=0;m<e.length;++m){var F=e[m];F.label&&(F=N.getTextInfo(layer,F.label,font,null,f),c=Math.max(c,F.width),u=Math.max(u,F.height))}d.labelWidth=
g.labelWidth||c;d.labelHeight=g.labelHeight||u});for(a=g.length-1;0<=a;--a)H(g[a]);J();b.each(g,function(a,b){"x"==b.direction?(b.box.left=C.left-b.labelWidth/2,b.box.width=N.width-C.left-C.right+b.labelWidth):(b.box.top=C.top-b.labelHeight/2,b.box.height=N.height-C.bottom-C.top+b.labelHeight)})}T=N.width-C.left-C.right;R=N.height-C.bottom-C.top;b.each(d,function(a,b){D(b)});c&&K();W()}function z(a){var d=a.options,c;"number"==typeof d.ticks&&0<d.ticks?c=d.ticks:c=.3*Math.sqrt("x"==a.direction?N.width:
N.height);c=(a.max-a.min)/c;var g=-Math.floor(Math.log(c)/Math.LN10),e=d.tickDecimals;null!=e&&g>e&&(g=e);var u=Math.pow(10,-g),f=c/u,m;1.5>f?m=1:3>f?(m=2,2.25<f&&(null==e||g+1<=e)&&(m=2.5,++g)):7.5>f?m=5:m=10;m*=u;null!=d.minTickSize&&m<d.minTickSize&&(m=d.minTickSize);a.delta=c;a.tickDecimals=Math.max(0,null!=e?e:g);a.tickSize=d.tickSize||m;if("time"==d.mode&&!a.tickGenerator)throw Error("Time mode requires the flot.time plugin.");a.tickGenerator||(a.tickGenerator=function(a){var b=[],d;d=a.tickSize;
d*=Math.floor(a.min/d);var c=0,g=Number.NaN,e;do e=g,g=d+c*a.tickSize,b.push(g),++c;while(g<a.max&&g!=e);return b},a.tickFormatter=function(a,b){var d=b.tickDecimals?Math.pow(10,b.tickDecimals):1,c=""+Math.round(a*d)/d;if(null!=b.tickDecimals){var g=c.indexOf("."),g=-1==g?0:c.length-g-1;if(g<b.tickDecimals)return(g?c:c+".")+(""+d).substr(1,b.tickDecimals-g)}return c});b.isFunction(d.tickFormatter)&&(a.tickFormatter=function(a,b){return""+d.tickFormatter(a,b)});if(null!=d.alignTicksWithAxis){var r=
("x"==a.direction?P:S)[d.alignTicksWithAxis-1];r&&r.used&&r!=a&&(m=a.tickGenerator(a),0<m.length&&(null==d.min&&(a.min=Math.min(a.min,m[0])),null==d.max&&1<m.length&&(a.max=Math.max(a.max,m[m.length-1]))),a.tickGenerator=function(a){var b=[],d,c;for(c=0;c<r.ticks.length;++c)d=(r.ticks[c].v-r.min)/(r.max-r.min),d=a.min+d*(a.max-a.min),b.push(d);return b},a.mode||null!=d.tickDecimals||(m=Math.max(0,-Math.floor(Math.log(a.delta)/Math.LN10)+1),c=a.tickGenerator(a),1<c.length&&/\..*0$/.test((c[1]-c[0]).toFixed(m))||
(a.tickDecimals=m)))}}function A(){N.clear();l(M.drawBackground,[w]);var a=v.grid;a.show&&a.backgroundColor&&(w.save(),w.translate(C.left,C.top),w.fillStyle=da(v.grid.backgroundColor,R,0,"rgba(255, 255, 255, 0)"),w.fillRect(0,0,T,R),w.restore());a.show&&!a.aboveData&&G();for(var b=0;b<I.length;++b){l(M.drawSeries,[w,I[b]]);var d=I[b];d.lines.show&&ba(d);d.bars.show&&O(d);d.points.show&&Z(d)}l(M.draw,[w]);a.show&&a.aboveData&&G();N.render();X()}function y(a,b){for(var d,c,g,e,u=x(),f=0;f<u.length;++f)if(d=
u[f],d.direction==b&&(e=b+d.n+"axis",!a[e]&&1==d.n&&(e=b+"axis"),a[e])){c=a[e].from;g=a[e].to;break}a[e]||(d="x"==b?P[0]:S[0],c=a[b+"1"],g=a[b+"2"]);null!=c&&null!=g&&c>g&&(e=c,c=g,g=e);return{from:c,to:g,axis:d}}function G(){var a,d,c,g;w.save();w.translate(C.left,C.top);if(c=v.grid.markings)for(b.isFunction(c)&&(d=u.getAxes(),d.xmin=d.xaxis.min,d.xmax=d.xaxis.max,d.ymin=d.yaxis.min,d.ymax=d.yaxis.max,c=c(d)),a=0;a<c.length;++a){d=c[a];var e=y(d,"x"),f=y(d,"y");null==e.from&&(e.from=e.axis.min);
null==e.to&&(e.to=e.axis.max);null==f.from&&(f.from=f.axis.min);null==f.to&&(f.to=f.axis.max);e.to<e.axis.min||e.from>e.axis.max||f.to<f.axis.min||f.from>f.axis.max||(e.from=Math.max(e.from,e.axis.min),e.to=Math.min(e.to,e.axis.max),f.from=Math.max(f.from,f.axis.min),f.to=Math.min(f.to,f.axis.max),e.from==e.to&&f.from==f.to)||(e.from=e.axis.p2c(e.from),e.to=e.axis.p2c(e.to),f.from=f.axis.p2c(f.from),f.to=f.axis.p2c(f.to),e.from==e.to||f.from==f.to?(w.beginPath(),w.strokeStyle=d.color||v.grid.markingsColor,
w.lineWidth=d.lineWidth||v.grid.markingsLineWidth,w.moveTo(e.from,f.from),w.lineTo(e.to,f.to),w.stroke()):(w.fillStyle=d.color||v.grid.markingsColor,w.fillRect(e.from,f.to,e.to-e.from,f.from-f.to)))}d=x();c=v.grid.borderWidth;for(e=0;e<d.length;++e){f=d[e];a=f.box;var m=f.tickLength,r,p,h,q;if(f.show&&0!=f.ticks.length){w.lineWidth=1;"x"==f.direction?(r=0,"full"==m?p="top"==f.position?0:R:p=a.top-C.top+("top"==f.position?a.height:0)):(p=0,"full"==m?r="left"==f.position?0:T:r=a.left-C.left+("left"==
f.position?a.width:0));f.innermost||(w.strokeStyle=f.options.color,w.beginPath(),h=q=0,"x"==f.direction?h=T+1:q=R+1,1==w.lineWidth&&("x"==f.direction?p=Math.floor(p)+.5:r=Math.floor(r)+.5),w.moveTo(r,p),w.lineTo(r+h,p+q),w.stroke());w.strokeStyle=f.options.tickColor;w.beginPath();for(a=0;a<f.ticks.length;++a){var k=f.ticks[a].v;h=q=0;isNaN(k)||k<f.min||k>f.max||"full"==m&&("object"==typeof c&&0<c[f.position]||0<c)&&(k==f.min||k==f.max)||("x"==f.direction?(r=f.p2c(k),q="full"==m?-R:m,"top"==f.position&&
(q=-q)):(p=f.p2c(k),h="full"==m?-T:m,"left"==f.position&&(h=-h)),1==w.lineWidth&&("x"==f.direction?r=Math.floor(r)+.5:p=Math.floor(p)+.5),w.moveTo(r,p),w.lineTo(r+h,p+q))}w.stroke()}}c&&(g=v.grid.borderColor,"object"==typeof c||"object"==typeof g?("object"!=typeof c&&(c={top:c,right:c,bottom:c,left:c}),"object"!=typeof g&&(g={top:g,right:g,bottom:g,left:g}),0<c.top&&(w.strokeStyle=g.top,w.lineWidth=c.top,w.beginPath(),w.moveTo(0-c.left,0-c.top/2),w.lineTo(T,0-c.top/2),w.stroke()),0<c.right&&(w.strokeStyle=
g.right,w.lineWidth=c.right,w.beginPath(),w.moveTo(T+c.right/2,0-c.top),w.lineTo(T+c.right/2,R),w.stroke()),0<c.bottom&&(w.strokeStyle=g.bottom,w.lineWidth=c.bottom,w.beginPath(),w.moveTo(T+c.right,R+c.bottom/2),w.lineTo(0,R+c.bottom/2),w.stroke()),0<c.left&&(w.strokeStyle=g.left,w.lineWidth=c.left,w.beginPath(),w.moveTo(0-c.left/2,R+c.bottom),w.lineTo(0-c.left/2,0),w.stroke())):(w.lineWidth=c,w.strokeStyle=v.grid.borderColor,w.strokeRect(-c/2,-c/2,T+c,R+c)));w.restore()}function K(){b.each(x(),function(a,
b){if(b.show&&0!=b.ticks.length){var d=b.box,c="flot-"+b.direction+"-axis flot-"+b.direction+b.n+"-axis "+(b.direction+"Axis "+b.direction+b.n+"Axis"),g=b.options.font||"flot-tick-label tickLabel",e,f,u,m,r;N.removeText(c);for(var p=0;p<b.ticks.length;++p)e=b.ticks[p],!e.label||e.v<b.min||e.v>b.max||("x"==b.direction?(m="center",f=C.left+b.p2c(e.v),"bottom"==b.position?u=d.top+d.padding:(u=d.top+d.height-d.padding,r="bottom")):(r="middle",u=C.top+b.p2c(e.v),"left"==b.position?(f=d.left+d.width-d.padding,
m="right"):f=d.left+d.padding),N.addText(c,f,u,e.label,g,null,null,m,r))}})}function ba(a){function b(a,d,c,g,e){var f=a.points;a=a.pointsize;var u=null,m=null;w.beginPath();for(var r=a;r<f.length;r+=a){var p=f[r-a],h=f[r-a+1],q=f[r],F=f[r+1];if(null!=p&&null!=q){if(h<=F&&h<e.min){if(F<e.min)continue;p=(e.min-h)/(F-h)*(q-p)+p;h=e.min}else if(F<=h&&F<e.min){if(h<e.min)continue;q=(e.min-h)/(F-h)*(q-p)+p;F=e.min}if(h>=F&&h>e.max){if(F>e.max)continue;p=(e.max-h)/(F-h)*(q-p)+p;h=e.max}else if(F>=h&&F>
e.max){if(h>e.max)continue;q=(e.max-h)/(F-h)*(q-p)+p;F=e.max}if(p<=q&&p<g.min){if(q<g.min)continue;h=(g.min-p)/(q-p)*(F-h)+h;p=g.min}else if(q<=p&&q<g.min){if(p<g.min)continue;F=(g.min-p)/(q-p)*(F-h)+h;q=g.min}if(p>=q&&p>g.max){if(q>g.max)continue;h=(g.max-p)/(q-p)*(F-h)+h;p=g.max}else if(q>=p&&q>g.max){if(p>g.max)continue;F=(g.max-p)/(q-p)*(F-h)+h;q=g.max}p==u&&h==m||w.moveTo(g.p2c(p)+d,e.p2c(h)+c);u=q;m=F;w.lineTo(g.p2c(q)+d,e.p2c(F)+c)}}w.stroke()}function d(a,b,c){var g=a.points;a=a.pointsize;
for(var e=Math.min(Math.max(0,c.min),c.max),f=0,u=!1,m=1,r=0,p=0;!(0<a&&f>g.length+a);){var f=f+a,h=g[f-a],q=g[f-a+m],F=g[f],k=g[f+m];if(u){if(0<a&&null!=h&&null==F){p=f;a=-a;m=2;continue}if(0>a&&f==r+a){w.fill();u=!1;a=-a;m=1;f=r=p+a;continue}}if(null!=h&&null!=F){if(h<=F&&h<b.min){if(F<b.min)continue;q=(b.min-h)/(F-h)*(k-q)+q;h=b.min}else if(F<=h&&F<b.min){if(h<b.min)continue;k=(b.min-h)/(F-h)*(k-q)+q;F=b.min}if(h>=F&&h>b.max){if(F>b.max)continue;q=(b.max-h)/(F-h)*(k-q)+q;h=b.max}else if(F>=h&&
F>b.max){if(h>b.max)continue;k=(b.max-h)/(F-h)*(k-q)+q;F=b.max}u||(w.beginPath(),w.moveTo(b.p2c(h),c.p2c(e)),u=!0);if(q>=c.max&&k>=c.max)w.lineTo(b.p2c(h),c.p2c(c.max)),w.lineTo(b.p2c(F),c.p2c(c.max));else if(q<=c.min&&k<=c.min)w.lineTo(b.p2c(h),c.p2c(c.min)),w.lineTo(b.p2c(F),c.p2c(c.min));else{var la=h,E=F;q<=k&&q<c.min&&k>=c.min?(h=(c.min-q)/(k-q)*(F-h)+h,q=c.min):k<=q&&k<c.min&&q>=c.min&&(F=(c.min-q)/(k-q)*(F-h)+h,k=c.min);q>=k&&q>c.max&&k<=c.max?(h=(c.max-q)/(k-q)*(F-h)+h,q=c.max):k>=q&&k>c.max&&
q<=c.max&&(F=(c.max-q)/(k-q)*(F-h)+h,k=c.max);h!=la&&w.lineTo(b.p2c(la),c.p2c(q));w.lineTo(b.p2c(h),c.p2c(q));w.lineTo(b.p2c(F),c.p2c(k));F!=E&&(w.lineTo(b.p2c(F),c.p2c(k)),w.lineTo(b.p2c(E),c.p2c(k)))}}}}w.save();w.translate(C.left,C.top);w.lineJoin="round";var c=a.lines.lineWidth,g=a.shadowSize;if(0<c&&0<g){w.lineWidth=g;w.strokeStyle="rgba(0,0,0,0.1)";var e=Math.PI/18;b(a.datapoints,Math.sin(e)*(c/2+g/2),Math.cos(e)*(c/2+g/2),a.xaxis,a.yaxis);w.lineWidth=g/2;b(a.datapoints,Math.sin(e)*(c/2+g/4),
Math.cos(e)*(c/2+g/4),a.xaxis,a.yaxis)}w.lineWidth=c;w.strokeStyle=a.color;(g=V(a.lines,a.color,0,R))&&(w.fillStyle=g,d(a.datapoints,a.xaxis,a.yaxis));0<c&&b(a.datapoints,0,0,a.xaxis,a.yaxis);w.restore()}function Z(a){function b(a,d,c,g,e,f,u,m){var r=a.points;a=a.pointsize;for(var h=0;h<r.length;h+=a){var p=r[h],q=r[h+1];null==p||p<f.min||p>f.max||q<u.min||q>u.max||(w.beginPath(),p=f.p2c(p),q=u.p2c(q)+g,"circle"==m?w.arc(p,q,d,0,e?Math.PI:2*Math.PI,!1):m(w,p,q,d,e),w.closePath(),c&&(w.fillStyle=
c,w.fill()),w.stroke())}}w.save();w.translate(C.left,C.top);var d=a.points.lineWidth,c=a.shadowSize,g=a.points.radius,e=a.points.symbol;0==d&&(d=1E-4);0<d&&0<c&&(c/=2,w.lineWidth=c,w.strokeStyle="rgba(0,0,0,0.1)",b(a.datapoints,g,null,c+c/2,!0,a.xaxis,a.yaxis,e),w.strokeStyle="rgba(0,0,0,0.2)",b(a.datapoints,g,null,c/2,!0,a.xaxis,a.yaxis,e));w.lineWidth=d;w.strokeStyle=a.color;b(a.datapoints,g,V(a.points,a.color),0,!1,a.xaxis,a.yaxis,e);w.restore()}function B(a,b,d,c,g,e,f,u,m,r,h,p){var q,k,E,D,
n,l,x,z,J;h?(z=l=x=!0,n=!1,q=d,k=a,D=b+c,E=b+g,k<q&&(J=k,k=q,q=J,n=!0,l=!1)):(n=l=x=!0,z=!1,q=a+c,k=a+g,E=d,D=b,D<E&&(J=D,D=E,E=J,z=!0,x=!1));k<u.min||q>u.max||D<m.min||E>m.max||(q<u.min&&(q=u.min,n=!1),k>u.max&&(k=u.max,l=!1),E<m.min&&(E=m.min,z=!1),D>m.max&&(D=m.max,x=!1),q=u.p2c(q),E=m.p2c(E),k=u.p2c(k),D=m.p2c(D),f&&(r.beginPath(),r.moveTo(q,E),r.lineTo(q,D),r.lineTo(k,D),r.lineTo(k,E),r.fillStyle=f(E,D),r.fill()),0<p&&(n||l||x||z)&&(r.beginPath(),r.moveTo(q,E+e),n?r.lineTo(q,D+e):r.moveTo(q,
D+e),x?r.lineTo(k,D+e):r.moveTo(k,D+e),l?r.lineTo(k,E+e):r.moveTo(k,E+e),z?r.lineTo(q,E+e):r.moveTo(q,E+e),r.stroke()))}function O(a){w.save();w.translate(C.left,C.top);w.lineWidth=a.bars.lineWidth;w.strokeStyle=a.color;var b;switch(a.bars.align){case "left":b=0;break;case "right":b=-a.bars.barWidth;break;case "center":b=-a.bars.barWidth/2;break;default:throw Error("Invalid bar alignment: "+a.bars.align);}(function(b,d,c,g,e,f,u){var m=b.points;b=b.pointsize;for(var r=0;r<m.length;r+=b)null!=m[r]&&
B(m[r],m[r+1],m[r+2],d,c,g,e,f,u,w,a.bars.horizontal,a.bars.lineWidth)})(a.datapoints,b,b+a.bars.barWidth,0,a.bars.fill?function(b,d){return V(a.bars,a.color,b,d)}:null,a.xaxis,a.yaxis);w.restore()}function V(a,d,c,g){var e=a.fill;if(!e)return null;if(a.fillColor)return da(a.fillColor,c,g,d);a=b.color.parse(d);return a.a="number"==typeof e?e:.4,a.normalize(),a.toString()}function W(){a.find(".legend").remove();if(v.legend.show){for(var d=[],c=[],e=!1,f=v.legend.labelFormatter,u,m,r=0;r<I.length;++r)u=
I[r],u.label&&(m=f?f(u.label,u):u.label,m&&c.push({label:m,color:u.color}));if(v.legend.sorted)if(b.isFunction(v.legend.sorted))c.sort(v.legend.sorted);else if("reverse"==v.legend.sorted)c.reverse();else{var h="descending"!=v.legend.sorted;c.sort(function(a,b){return a.label==b.label?0:a.label<b.label!=h?1:-1})}for(r=0;r<c.length;++r)f=c[r],0==r%v.legend.noColumns&&(e&&d.push("</tr>"),d.push("<tr>"),e=!0),d.push('<td class="legendColorBox"><div style="border:1px solid '+v.legend.labelBoxBorderColor+
';padding:1px"><div style="width:4px;height:0;border:5px solid '+f.color+';overflow:hidden"></div></div></td><td class="legendLabel">'+f.label+"</td>");e&&d.push("</tr>");0!=d.length&&(c='<table style="font-size:smaller;color:'+v.grid.color+'">'+d.join("")+"</table>",null!=v.legend.container?b(v.legend.container).html(c):(d="",e=v.legend.position,r=v.legend.margin,null==r[0]&&(r=[r,r]),"n"==e.charAt(0)?d+="top:"+(r[1]+C.top)+"px;":"s"==e.charAt(0)&&(d+="bottom:"+(r[1]+C.bottom)+"px;"),"e"==e.charAt(1)?
d+="right:"+(r[0]+C.right)+"px;":"w"==e.charAt(1)&&(d+="left:"+(r[0]+C.left)+"px;"),c=b('<div class="legend">'+c.replace('style="','style="position:absolute;'+d+";")+"</div>").appendTo(a),0!=v.legend.backgroundOpacity&&(e=v.legend.backgroundColor,null==e&&(e=v.grid.backgroundColor,e&&"string"==typeof e?e=b.color.parse(e):e=b.color.extract(c,"background-color"),e.a=1,e=e.toString()),r=c.children(),b('<div style="position:absolute;width:'+r.width()+"px;height:"+r.height()+"px;"+d+"background-color:"+
e+';"> </div>').prependTo(c).css("opacity",v.legend.backgroundOpacity))))}}function ca(a){v.grid.hoverable&&aa("plothover",a,function(a){return 0!=a.hoverable})}function ea(a){v.grid.hoverable&&aa("plothover",a,function(a){return!1})}function fa(a){aa("plotclick",a,function(a){return 0!=a.clickable})}function aa(b,d,c){var e=U.offset(),f=d.pageX-e.left-C.left,u=d.pageY-e.top-C.top,h=m({left:f,top:u});h.pageX=d.pageX;h.pageY=d.pageY;var p=v.grid.mouseActiveRadius,q=p*p+1,k=null,E,D;for(d=I.length-
1;0<=d;--d)if(c(I[d])){var n=I[d],l=n.xaxis,x=n.yaxis,z=n.datapoints.points,J=l.c2p(f),H=x.c2p(u),B=p/l.scale,A=p/x.scale;D=n.datapoints.pointsize;l.options.inverseTransform&&(B=Number.MAX_VALUE);x.options.inverseTransform&&(A=Number.MAX_VALUE);if(n.lines.show||n.points.show)for(E=0;E<z.length;E+=D){var w=z[E],y=z[E+1];null==w||w-J>B||w-J<-B||y-H>A||y-H<-A||(w=Math.abs(l.p2c(w)-f),y=Math.abs(x.p2c(y)-u),y=w*w+y*y,y<q&&(q=y,k=[d,E/D]))}if(n.bars.show&&!k)for(l="left"==n.bars.align?0:-n.bars.barWidth/
2,n=l+n.bars.barWidth,E=0;E<z.length;E+=D)w=z[E],y=z[E+1],x=z[E+2],null!=w&&(I[d].bars.horizontal?J<=Math.max(x,w)&&J>=Math.min(x,w)&&H>=y+l&&H<=y+n:J>=w+l&&J<=w+n&&H>=Math.min(x,y)&&H<=Math.max(x,y))&&(k=[d,E/D])}(c=k?(d=k[0],E=k[1],D=I[d].datapoints.pointsize,{datapoint:I[d].datapoints.points.slice(E*D,(E+1)*D),dataIndex:E,series:I[d],seriesIndex:d}):null)&&(c.pageX=parseInt(c.series.xaxis.p2c(c.datapoint[0])+e.left+C.left,10),c.pageY=parseInt(c.series.yaxis.p2c(c.datapoint[1])+e.top+C.top,10));
if(v.grid.autoHighlight){for(e=0;e<r.length;++e)E=r[e],E.auto!=b||c&&E.series==c.series&&E.point[0]==c.datapoint[0]&&E.point[1]==c.datapoint[1]||ga(E.series,E.point);c&&ha(c.series,c.datapoint,b)}a.trigger(b,[h,c])}function X(){var a=v.interaction.redrawOverlayInterval;-1==a?ia():E||(E=setTimeout(ia,a))}function ia(){E=null;Q.save();Y.clear();Q.translate(C.left,C.top);var a,d;for(a=0;a<r.length;++a)if(d=r[a],d.series.bars.show)ka(d.series,d.point);else{var c=d.series,e=d.point;d=e[0];var e=e[1],g=
c.xaxis,f=c.yaxis,u="string"==typeof c.highlightColor?c.highlightColor:b.color.parse(c.color).scale("a",.5).toString();if(!(d<g.min||d>g.max||e<f.min||e>f.max)){var m=c.points.radius+c.points.lineWidth/2;Q.lineWidth=m;Q.strokeStyle=u;u=1.5*m;d=g.p2c(d);e=f.p2c(e);Q.beginPath();"circle"==c.points.symbol?Q.arc(d,e,u,0,2*Math.PI,!1):c.points.symbol(Q,d,e,u,!1);Q.closePath();Q.stroke()}}Q.restore();l(M.drawOverlay,[Q])}function ha(a,b,d){"number"==typeof a&&(a=I[a]);if("number"==typeof b){var c=a.datapoints.pointsize;
b=a.datapoints.points.slice(c*b,c*(b+1))}c=ja(a,b);-1==c?(r.push({series:a,point:b,auto:d}),X()):d||(r[c].auto=!1)}function ga(a,b){if(null==a&&null==b)r=[],X();else{"number"==typeof a&&(a=I[a]);if("number"==typeof b){var d=a.datapoints.pointsize;b=a.datapoints.points.slice(d*b,d*(b+1))}d=ja(a,b);-1!=d&&(r.splice(d,1),X())}}function ja(a,b){for(var d=0;d<r.length;++d){var c=r[d];if(c.series==a&&c.point[0]==b[0]&&c.point[1]==b[1])return d}return-1}function ka(a,d){var c="string"==typeof a.highlightColor?
a.highlightColor:b.color.parse(a.color).scale("a",.5).toString(),e="left"==a.bars.align?0:-a.bars.barWidth/2;Q.lineWidth=a.bars.lineWidth;Q.strokeStyle=c;B(d[0],d[1],d[2]||0,e,e+a.bars.barWidth,0,function(){return c},a.xaxis,a.yaxis,Q,a.bars.horizontal,a.bars.lineWidth)}function da(a,d,c,e){if("string"==typeof a)return a;d=w.createLinearGradient(0,c,0,d);c=0;for(var g=a.colors.length;c<g;++c){var f=a.colors[c];if("string"!=typeof f){var u=b.color.parse(e);null!=f.brightness&&(u=u.scale("rgb",f.brightness));
null!=f.opacity&&(u.a*=f.opacity);f=u.toString()}d.addColorStop(c/(g-1),f)}return d}var I=[],v={colors:["#edc240","#afd8f8","#cb4b4b","#4da74d","#9440ed"],legend:{show:!0,noColumns:1,labelFormatter:null,labelBoxBorderColor:"#ccc",container:null,position:"ne",margin:5,backgroundColor:null,backgroundOpacity:.85,sorted:null},xaxis:{show:null,position:"bottom",mode:null,font:null,color:null,tickColor:null,transform:null,inverseTransform:null,min:null,max:null,autoscaleMargin:null,ticks:null,tickFormatter:null,
labelWidth:null,labelHeight:null,reserveSpace:null,tickLength:null,alignTicksWithAxis:null,tickDecimals:null,tickSize:null,minTickSize:null},yaxis:{autoscaleMargin:.02,position:"left"},xaxes:[],yaxes:[],series:{points:{show:!1,radius:3,lineWidth:2,fill:!0,fillColor:"#ffffff",symbol:"circle"},lines:{lineWidth:2,fill:!1,fillColor:null,steps:!1},bars:{show:!1,lineWidth:2,barWidth:1,fill:!0,fillColor:null,align:"left",horizontal:!1,zero:!0},shadowSize:3,highlightColor:null},grid:{show:!0,aboveData:!1,
color:"#545454",backgroundColor:null,borderColor:null,tickColor:null,margin:0,labelMargin:5,axisMargin:8,borderWidth:2,minBorderMargin:null,markings:null,markingsColor:"#f4f4f4",markingsLineWidth:2,clickable:!1,hoverable:!1,autoHighlight:!0,mouseActiveRadius:10},interaction:{redrawOverlayInterval:1E3/60},hooks:{}},N=null,Y=null,U=null,w=null,Q=null,P=[],S=[],C={left:0,right:0,top:0,bottom:0},T=0,R=0,M={processOptions:[],processRawData:[],processDatapoints:[],processOffset:[],drawBackground:[],drawSeries:[],
draw:[],bindEvents:[],drawOverlay:[],shutdown:[]},u=this;u.setData=k;u.setupGrid=L;u.draw=A;u.getPlaceholder=function(){return a};u.getCanvas=function(){return N.element};u.getPlotOffset=function(){return C};u.width=function(){return T};u.height=function(){return R};u.offset=function(){var a=U.offset();return a.left+=C.left,a.top+=C.top,a};u.getData=function(){return I};u.getAxes=function(){var a={};return b.each(P.concat(S),function(b,d){d&&(a[d.direction+(1!=d.n?d.n:"")+"axis"]=d)}),a};u.getXAxes=
function(){return P};u.getYAxes=function(){return S};u.c2p=m;u.p2c=function(a){var b={},d,c,e;for(d=0;d<P.length;++d)if((c=P[d])&&c.used&&(e="x"+c.n,null==a[e]&&1==c.n&&(e="x"),null!=a[e])){b.left=c.p2c(a[e]);break}for(d=0;d<S.length;++d)if((c=S[d])&&c.used&&(e="y"+c.n,null==a[e]&&1==c.n&&(e="y"),null!=a[e])){b.top=c.p2c(a[e]);break}return b};u.getOptions=function(){return v};u.highlight=ha;u.unhighlight=ga;u.triggerRedrawOverlay=X;u.pointOffset=function(a){return{left:parseInt(P[n(a,"x")-1].p2c(+a.x)+
C.left,10),top:parseInt(S[n(a,"y")-1].p2c(+a.y)+C.top,10)}};u.shutdown=function(){E&&clearTimeout(E);U.unbind("mousemove",ca);U.unbind("mouseleave",ea);U.unbind("click",fa);l(M.shutdown,[U])};u.resize=function(){var b=a.width(),d=a.height();N.resize(b,d);Y.resize(b,d)};u.hooks=M;(function(){for(var a={Canvas:c},d=0;d<h.length;++d){var e=h[d];e.init(u,a);e.options&&b.extend(!0,v,e.options)}})(u);(function(d){b.extend(!0,v,d);d&&d.colors&&(v.colors=d.colors);null==v.xaxis.color&&(v.xaxis.color=b.color.parse(v.grid.color).scale("a",
.22).toString());null==v.yaxis.color&&(v.yaxis.color=b.color.parse(v.grid.color).scale("a",.22).toString());null==v.xaxis.tickColor&&(v.xaxis.tickColor=v.grid.tickColor||v.xaxis.color);null==v.yaxis.tickColor&&(v.yaxis.tickColor=v.grid.tickColor||v.yaxis.color);null==v.grid.borderColor&&(v.grid.borderColor=v.grid.color);null==v.grid.tickColor&&(v.grid.tickColor=b.color.parse(v.grid.color).scale("a",.22).toString());var c,e,f={style:a.css("font-style"),size:Math.round(.8*(+a.css("font-size").replace("px",
"")||13)),variant:a.css("font-variant"),weight:a.css("font-weight"),family:a.css("font-family")};f.lineHeight=1.15*f.size;e=v.xaxes.length||1;for(d=0;d<e;++d)(c=v.xaxes[d])&&!c.tickColor&&(c.tickColor=c.color),c=b.extend(!0,{},v.xaxis,c),v.xaxes[d]=c,c.font&&(c.font=b.extend({},f,c.font),c.font.color||(c.font.color=c.color));e=v.yaxes.length||1;for(d=0;d<e;++d)(c=v.yaxes[d])&&!c.tickColor&&(c.tickColor=c.color),c=b.extend(!0,{},v.yaxis,c),v.yaxes[d]=c,c.font&&(c.font=b.extend({},f,c.font),c.font.color||
(c.font.color=c.color));v.xaxis.noTicks&&null==v.xaxis.ticks&&(v.xaxis.ticks=v.xaxis.noTicks);v.yaxis.noTicks&&null==v.yaxis.ticks&&(v.yaxis.ticks=v.yaxis.noTicks);v.x2axis&&(v.xaxes[1]=b.extend(!0,{},v.xaxis,v.x2axis),v.xaxes[1].position="top");v.y2axis&&(v.yaxes[1]=b.extend(!0,{},v.yaxis,v.y2axis),v.yaxes[1].position="right");v.grid.coloredAreas&&(v.grid.markings=v.grid.coloredAreas);v.grid.coloredAreasColor&&(v.grid.markingsColor=v.grid.coloredAreasColor);v.lines&&b.extend(!0,v.series.lines,v.lines);
v.points&&b.extend(!0,v.series.points,v.points);v.bars&&b.extend(!0,v.series.bars,v.bars);null!=v.shadowSize&&(v.series.shadowSize=v.shadowSize);null!=v.highlightColor&&(v.series.highlightColor=v.highlightColor);for(d=0;d<v.xaxes.length;++d)p(P,d+1).options=v.xaxes[d];for(d=0;d<v.yaxes.length;++d)p(S,d+1).options=v.yaxes[d];for(var u in M)v.hooks[u]&&v.hooks[u].length&&(M[u]=M[u].concat(v.hooks[u]));l(M.processOptions,[v])})(f);(function(){a.css("padding",0).children(":not(.flot-base,.flot-overlay)").remove();
"static"==a.css("position")&&a.css("position","relative");N=new c("flot-base",a);Y=new c("flot-overlay",a);w=N.context;Q=Y.context;U=b(Y.element).unbind();var d=a.data("plot");d&&(d.shutdown(),Y.clear());a.data("plot",u)})();k(d);L();A();v.grid.hoverable&&(U.mousemove(ca),U.bind("mouseleave",ea));v.grid.clickable&&U.click(fa);l(M.bindEvents,[U]);var r=[],E=null}var d=Object.prototype.hasOwnProperty;c.prototype.resize=function(a,b){if(0>=a||0>=b)throw Error("Invalid dimensions for plot, width = "+
a+", height = "+b);var d=this.element,c=this.context,l=this.pixelRatio;this.width!=a&&(d.width=a*l,d.style.width=a+"px",this.width=a);this.height!=b&&(d.height=b*l,d.style.height=b+"px",this.height=b);c.restore();c.save();c.scale(l,l)};c.prototype.clear=function(){this.context.clearRect(0,0,this.width,this.height)};c.prototype.render=function(){var a=this._textCache,b;for(b in a)if(d.call(a,b)){var c=this.getTextLayer(b),h=a[b];c.hide();for(var l in h)if(d.call(h,l)){var k=h[l],n;for(n in k)if(d.call(k,
n)){for(var x=k[n].positions,m=0,p;p=x[m];m++)p.active?p.rendered||(c.append(p.element),p.rendered=!0):(x.splice(m--,1),p.rendered&&p.element.detach());0==x.length&&delete k[n]}}c.show()}};c.prototype.getTextLayer=function(a){var d=this.text[a];return null==d&&(null==this.textContainer&&(this.textContainer=b("<div class='flot-text'></div>").css({position:"absolute",top:0,left:0,bottom:0,right:0,"font-size":"smaller",color:"#545454"}).insertAfter(this.element)),d=this.text[a]=b("<div></div>").addClass(a).css({position:"absolute",
top:0,left:0,bottom:0,right:0}).appendTo(this.textContainer)),d};c.prototype.getTextInfo=function(a,d,c,h,l){var k,n;d=""+d;"object"==typeof c?k=c.style+" "+c.variant+" "+c.weight+" "+c.size+"px/"+c.lineHeight+"px "+c.family:k=c;n=this._textCache[a];null==n&&(n=this._textCache[a]={});h=n[k];null==h&&(h=n[k]={});n=h[d];null==n&&(a=b("<div></div>").html(d).css({position:"absolute","max-width":l,top:-9999}).appendTo(this.getTextLayer(a)),"object"==typeof c?a.css({font:k,color:c.color}):"string"==typeof c&&
a.addClass(c),n=h[d]={width:a.outerWidth(!0),height:a.outerHeight(!0),element:a,positions:[]},a.detach());return n};c.prototype.addText=function(a,d,b,c,l,k,n,x,m){a=this.getTextInfo(a,c,l,k,n);c=a.positions;"center"==x?d-=a.width/2:"right"==x&&(d-=a.width);"middle"==m?b-=a.height/2:"bottom"==m&&(b-=a.height);for(m=0;l=c[m];m++)if(l.x==d&&l.y==b){l.active=!0;return}l={active:!0,rendered:!1,element:c.length?a.element.clone():a.element,x:d,y:b};c.push(l);l.element.css({top:Math.round(b),left:Math.round(d),
"text-align":x})};c.prototype.removeText=function(a,b,c,h,l,k){if(null==h){if(b=this._textCache[a],null!=b)for(var n in b)if(d.call(b,n)){c=b[n];for(var x in c)if(d.call(c,x))for(a=c[x].positions,h=0;l=a[h];h++)l.active=!1}}else for(a=this.getTextInfo(a,h,l,k).positions,h=0;l=a[h];h++)l.x==b&&l.y==c&&(l.active=!1)};b.plot=function(d,c,f){return new a(b(d),c,f,b.plot.plugins)};b.plot.version="0.8.1";b.plot.plugins=[];b.fn.plot=function(a,d){return this.each(function(){b.plot(this,a,d)})}})(jQuery);
(function(b,c,a){function d(){f=c[h](function(){g.each(function(){var a=b(this),d=a.width(),c=a.height(),e=b.data(this,k);d===e.w&&c===e.h||a.trigger(l,[e.w=d,e.h=c])});d()},e[n])}var g=b([]),e=b.resize=b.extend(b.resize,{}),f,h="setTimeout",l="resize",k=l+"-special-event",n="delay";e[n]=250;e.throttleWindow=!0;b.event.special[l]={setup:function(){if(!e.throttleWindow&&this[h])return!1;var a=b(this);g=g.add(a);b.data(this,k,{w:a.width(),h:a.height()});1===g.length&&d()},teardown:function(){if(!e.throttleWindow&&
this[h])return!1;var a=b(this);g=g.not(a);a.removeData(k);g.length||clearTimeout(f)},add:function(d){function c(d,e,f){var m=b(this),h=b.data(this,k);h.w=e!==a?e:m.width();h.h=f!==a?f:m.height();g.apply(this,arguments)}if(!e.throttleWindow&&this[h])return!1;var g;if(b.isFunction(d))return g=d,c;g=d.handler;d.handler=c}}})(jQuery,this);
(function(b){b.plot.plugins.push({init:function(b){function a(){var a=b.getPlaceholder();0!=a.width()&&0!=a.height()&&(b.resize(),b.setupGrid(),b.draw())}b.hooks.bindEvents.push(function(b,c){b.getPlaceholder().resize(a)});b.hooks.shutdown.push(function(b,c){b.getPlaceholder().unbind("resize",a)})},options:{},name:"resize",version:"1.0"})})(jQuery);
(function(b){function c(a,b){return b*Math.floor(a/b)}function a(a,b,d,c){if("function"==typeof a.strftime)return a.strftime(b);var e=function(a,b){return a=""+a,b=""+(null==b?"0":b),1==a.length?b+a:a},g=[],f=!1,h=a.getHours(),l=12>h;null==d&&(d="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "));null==c&&(c="Sun Mon Tue Wed Thu Fri Sat".split(" "));var L;12<h?L=h-12:0==h?L=12:L=h;for(var z=0;z<b.length;++z){var A=b.charAt(z);if(f){switch(A){case "a":A=""+c[a.getDay()];break;case "b":A=
""+d[a.getMonth()];break;case "d":A=e(a.getDate());break;case "e":A=e(a.getDate()," ");break;case "h":case "H":A=e(h);break;case "I":A=e(L);break;case "l":A=e(L," ");break;case "m":A=e(a.getMonth()+1);break;case "M":A=e(a.getMinutes());break;case "q":A=""+(Math.floor(a.getMonth()/3)+1);break;case "S":A=e(a.getSeconds());break;case "y":A=e(a.getFullYear()%100);break;case "Y":A=""+a.getFullYear();break;case "p":A=l?"am":"pm";break;case "P":A=l?"AM":"PM";break;case "w":A=""+a.getDay()}g.push(A);f=!1}else"%"==
A?f=!0:g.push(A)}return g.join("")}function d(a){function b(a,d,c,e){a[d]=function(){return c[e].apply(c,arguments)}}var d={date:a};void 0!=a.strftime&&b(d,"strftime",a,"strftime");b(d,"getTime",a,"getTime");b(d,"setTime",a,"setTime");for(var c="Date Day FullYear Hours Milliseconds Minutes Month Seconds".split(" "),e=0;e<c.length;e++)b(d,"get"+c[e],a,"getUTC"+c[e]),b(d,"set"+c[e],a,"setUTC"+c[e]);return d}function g(a,b){if("browser"==b.timezone)return new Date(a);if(!b.timezone||"utc"==b.timezone)return d(new Date(a));
if("undefined"!=typeof timezoneJS&&"undefined"!=typeof timezoneJS.Date){var c=new timezoneJS.Date;return c.setTimezone(b.timezone),c.setTime(a),c}return d(new Date(a))}var e={second:1E3,minute:6E4,hour:36E5,day:864E5,month:2592E6,quarter:7776E6,year:525949.2*6E4},f=[[1,"second"],[2,"second"],[5,"second"],[10,"second"],[30,"second"],[1,"minute"],[2,"minute"],[5,"minute"],[10,"minute"],[30,"minute"],[1,"hour"],[2,"hour"],[4,"hour"],[8,"hour"],[12,"hour"],[1,"day"],[2,"day"],[3,"day"],[.25,"month"],
[.5,"month"],[1,"month"],[2,"month"]],h=f.concat([[3,"month"],[6,"month"],[1,"year"]]),l=f.concat([[1,"quarter"],[2,"quarter"],[1,"year"]]);b.plot.plugins.push({init:function(d){d.hooks.processOptions.push(function(d,f){b.each(d.getAxes(),function(b,d){var f=d.options;"time"==f.mode&&(d.tickGenerator=function(a){var b=[],d=g(a.min,f),m=0,p=f.tickSize&&"quarter"===f.tickSize[1]||f.minTickSize&&"quarter"===f.minTickSize[1]?l:h;null!=f.minTickSize&&("number"==typeof f.tickSize?m=f.tickSize:m=f.minTickSize[0]*
e[f.minTickSize[1]]);for(var k=0;k<p.length-1&&!(a.delta<(p[k][0]*e[p[k][1]]+p[k+1][0]*e[p[k+1][1]])/2&&p[k][0]*e[p[k][1]]>=m);++k);m=p[k][0];p=p[k][1];if("year"==p){if(null!=f.minTickSize&&"year"==f.minTickSize[1])m=Math.floor(f.minTickSize[0]);else{var k=Math.pow(10,Math.floor(Math.log(a.delta/e.year)/Math.LN10)),n=a.delta/e.year/k;1.5>n?m=1:3>n?m=2:7.5>n?m=5:m=10;m*=k}1>m&&(m=1)}a.tickSize=f.tickSize||[m,p];m=a.tickSize[0];p=a.tickSize[1];k=m*e[p];"second"==p?d.setSeconds(c(d.getSeconds(),m)):
"minute"==p?d.setMinutes(c(d.getMinutes(),m)):"hour"==p?d.setHours(c(d.getHours(),m)):"month"==p?d.setMonth(c(d.getMonth(),m)):"quarter"==p?d.setMonth(3*c(d.getMonth()/3,m)):"year"==p&&d.setFullYear(c(d.getFullYear(),m));d.setMilliseconds(0);k>=e.minute&&d.setSeconds(0);k>=e.hour&&d.setMinutes(0);k>=e.day&&d.setHours(0);k>=4*e.day&&d.setDate(1);k>=2*e.month&&d.setMonth(c(d.getMonth(),3));k>=2*e.quarter&&d.setMonth(c(d.getMonth(),6));k>=e.year&&d.setMonth(0);var n=0,x=Number.NaN,K;do if(K=x,x=d.getTime(),
b.push(x),"month"==p||"quarter"==p)if(1>m){d.setDate(1);var ba=d.getTime();d.setMonth(d.getMonth()+("quarter"==p?3:1));var Z=d.getTime();d.setTime(x+n*e.hour+(Z-ba)*m);n=d.getHours();d.setHours(0)}else d.setMonth(d.getMonth()+m*("quarter"==p?3:1));else"year"==p?d.setFullYear(d.getFullYear()+m):d.setTime(x+k);while(x<a.max&&x!=K);return b},d.tickFormatter=function(d,b){var c=g(d,b.options);if(null!=f.timeformat)return a(c,f.timeformat,f.monthNames,f.dayNames);var m=b.options.tickSize&&"quarter"==b.options.tickSize[1]||
b.options.minTickSize&&"quarter"==b.options.minTickSize[1],h=b.tickSize[0]*e[b.tickSize[1]],p=b.max-b.min,k=f.twelveHourClock?" %p":"",l=f.twelveHourClock?"%I":"%H",n;h<e.minute?n=l+":%M:%S"+k:h<e.day?p<2*e.day?n=l+":%M"+k:n="%b %d "+l+":%M"+k:h<e.month?n="%b %d":m&&h<e.quarter||!m&&h<e.year?p<e.year?n="%b":n="%b %Y":m&&h<e.year?p<e.year?n="Q%q":n="Q%q %Y":n="%Y";return a(c,n,f.monthNames,f.dayNames)})})})},options:{xaxis:{timezone:null,timeformat:null,twelveHourClock:!1,monthNames:null}},name:"time",
version:"1.0"});b.plot.formatDate=a})(jQuery);
(function(b){b.plot.plugins.push({init:function(b){function a(a,d){for(var b=[],c=0;c<a.length;c++)b[0]=a[c].data[0][d],b[1]=a[c].data[a[c].data.length-1][d];return b}function d(a,d){var b=a.bars.order,c=d.bars.order;return b<c?-1:b>c?1:0}function g(a,d,b){for(var c=0;d<=b;d++)c+=a[d].bars.barWidth+2*l;return c}var e,f,h,l,k=1,n=!1;b.hooks.processDatapoints.push(function(b,c,p){var q=null;if(null!=c.bars&&c.bars.show&&null!=c.bars.order){c.bars.horizontal&&(n=!0);var D=n?b.getPlaceholder().innerHeight():
b.getPlaceholder().innerWidth(),H=n?a(b.getData(),1):a(b.getData(),0);k=(H[1]-H[0])/D;b=b.getData();D=[];for(H=0;H<b.length;H++)null!=b[H].bars.order&&b[H].bars.show&&D.push(b[H]);e=D.sort(d);f=e.length;h=c.bars.lineWidth?c.bars.lineWidth:2;l=h*k;if(2<=f){for(b=q=0;b<e.length;++b)if(c==e[b]){q=b;break}q+=1;b=b=0;0!=f%2&&(b=e[Math.ceil(f/2)].bars.barWidth/2);q=b=q<=Math.ceil(f/2)?-1*g(e,q-1,Math.floor(f/2)-1)-b:g(e,Math.ceil(f/2),q-2)+b+2*l;b=p.pointsize;for(var D=p.points,H=0,J=n?1:0;J<D.length;J+=
b)D[J]+=q,c.data[H][3]=D[J],H++;q=D;p.points=q}}return q})},options:{series:{bars:{order:null}}},name:"orderBars",version:"0.2"})})(jQuery);
(function(b){var c=function(a){this.tipPosition={x:0,y:0};this.init(a)};c.prototype.init=function(a){function d(a){var b={};b.x=a.pageX;b.y=a.pageY;e.updateTooltipPosition(b)}function c(a,b,d){a=e.getDomElement();if(d){var g;g=e.stringFormat(e.tooltipOptions.content,d);a.html(g);e.updateTooltipPosition({x:b.pageX,y:b.pageY});a.css({left:e.tipPosition.x+e.tooltipOptions.shifts.x,top:e.tipPosition.y+e.tooltipOptions.shifts.y}).show();"function"==typeof e.tooltipOptions.onHover&&e.tooltipOptions.onHover(d,
a)}else a.hide().html("")}var e=this;a.hooks.bindEvents.push(function(a,h){e.plotOptions=a.getOptions();!1!==e.plotOptions.tooltip&&void 0!==e.plotOptions.tooltip&&(e.tooltipOptions=e.plotOptions.tooltipOpts,e.getDomElement(),b(a.getPlaceholder()).bind("plothover",c),b(h).bind("mousemove",d))});a.hooks.shutdown.push(function(a,e){b(a.getPlaceholder()).unbind("plothover",c);b(e).unbind("mousemove",d)})};c.prototype.getDomElement=function(){var a;return 0<b("#flotTip").length?a=b("#flotTip"):(a=b("<div />").attr("id",
"flotTip"),a.appendTo("body").hide().css({position:"absolute"}),this.tooltipOptions.defaultTheme&&a.css({background:"#fff","z-index":"100",padding:"0.4em 0.6em","border-radius":"0.5em","font-size":"0.8em",border:"1px solid #111",display:"none","white-space":"nowrap"})),a};c.prototype.updateTooltipPosition=function(a){var d=b("#flotTip").outerWidth()+this.tooltipOptions.shifts.x,c=b("#flotTip").outerHeight()+this.tooltipOptions.shifts.y;a.x-b(window).scrollLeft()>b(window).innerWidth()-d&&(a.x-=d);
a.y-b(window).scrollTop()>b(window).innerHeight()-c&&(a.y-=c);this.tipPosition.x=a.x;this.tipPosition.y=a.y};c.prototype.stringFormat=function(a,b){var c=/%p\.{0,1}(\d{0,})/,e=/%s/,f=/%x\.{0,1}(?:\d{0,})/,h=/%y\.{0,1}(?:\d{0,})/,l=b.datapoint[0],k=b.datapoint[1];return"function"==typeof a&&(a=a(b.series.label,l,k,b)),void 0!==b.series.percent&&(a=this.adjustValPrecision(c,a,b.series.percent)),void 0!==b.series.label&&(a=a.replace(e,b.series.label)),this.isTimeMode("xaxis",b)&&this.isXDateFormat(b)&&
(a=a.replace(f,this.timestampToDate(l,this.tooltipOptions.xDateFormat))),this.isTimeMode("yaxis",b)&&this.isYDateFormat(b)&&(a=a.replace(h,this.timestampToDate(k,this.tooltipOptions.yDateFormat))),"number"==typeof l&&(a=this.adjustValPrecision(f,a,l)),"number"==typeof k&&(a=this.adjustValPrecision(h,a,k)),void 0!==b.series.xaxis.tickFormatter&&(a=a.replace(f,b.series.xaxis.tickFormatter(l,b.series.xaxis))),void 0!==b.series.yaxis.tickFormatter&&(a=a.replace(h,b.series.yaxis.tickFormatter(k,b.series.yaxis))),
a};c.prototype.isTimeMode=function(a,b){return void 0!==b.series[a].options.mode&&"time"===b.series[a].options.mode};c.prototype.isXDateFormat=function(){return void 0!==this.tooltipOptions.xDateFormat&&null!==this.tooltipOptions.xDateFormat};c.prototype.isYDateFormat=function(){return void 0!==this.tooltipOptions.yDateFormat&&null!==this.tooltipOptions.yDateFormat};c.prototype.timestampToDate=function(a,d){return b.plot.formatDate(new Date(1*a),d,this.tooltipOptions.monthNames,this.tooltipOptions.dayNames)};
c.prototype.adjustValPrecision=function(a,b,c){var e;return null!==b.match(a)&&""!==RegExp.$1&&(e=RegExp.$1,c=c.toFixed(e),b=b.replace(a,c)),b};b.plot.plugins.push({init:function(a){new c(a)},options:{tooltip:!1,tooltipOpts:{content:"%s | X: %x | Y: %y",xDateFormat:null,yDateFormat:null,monthNames:null,dayNames:null,shifts:{x:10,y:20},defaultTheme:!0,onHover:function(){}}},name:"tooltip",version:"0.6.1"})})(jQuery);
(function(b){b.fn.mapael=function(c){c=b.extend(!0,{},b.fn.mapael.defaultOptions,c);return this.each(function(){var a=b(this),d=b("<div>").addClass(c.map.tooltip.cssClass).css("display","none"),g=b("."+c.map.cssClass,this).empty().append(d),e=b.fn.mapael.maps[c.map.name],f=new Raphael(g[0],e.width,e.height),h={},l=0,k={},n={},x={},m={},p=0,h={},h=[];c.map.tooltip.css&&d.css(c.map.tooltip.css);f.setViewBox(0,0,e.width,e.height,!1);for(p in e.elems)h=b.fn.mapael.getElemOptions(c.map.defaultArea,c.areas[p]?
c.areas[p]:{},c.legend.area),k[p]={mapElem:f.path(e.elems[p]).attr(h.attrs)};for(p in e.elems)h=b.fn.mapael.getElemOptions(c.map.defaultArea,c.areas[p]?c.areas[p]:{},c.legend.area),b.fn.mapael.initElem(f,k[p],h,d,p);for(p in c.plots)n[p]=b.fn.mapael.drawPlot(p,c,e,f,d);a.on("zoom",function(b,d,g,m){b=Math.min(Math.max(d,0),c.map.zoom.maxLevel);a.data("zoomLevel",b);"undefined"==typeof g&&(g=f._viewBox[0]+f._viewBox[2]/2);"undefined"==typeof m&&(m=f._viewBox[1]+f._viewBox[3]/2);0==b?f.setViewBox(0,
0,e.width,e.height):f.setViewBox(Math.min(Math.max(0,g-e.width/(1+b*c.map.zoom.step)/2),e.width-e.width/(1+b*c.map.zoom.step)),Math.min(Math.max(0,m-e.height/(1+b*c.map.zoom.step)/2),e.height-e.height/(1+b*c.map.zoom.step)),e.width/(1+b*c.map.zoom.step),e.height/(1+b*c.map.zoom.step))});c.map.zoom.enabled&&b.fn.mapael.initZoom(g,f,e.width,e.height,c.map.zoom);"undefined"!=typeof c.map.zoom.init&&(c.map.zoom.init.latitude&&c.map.zoom.init.longitude?(h=e.getCoords(c.map.zoom.init.latitude,c.map.zoom.init.longitude),
h=[c.map.zoom.init.level,h.x,h.y]):h="undefined"!=typeof c.map.zoom.init.x&&"undefined"!=typeof c.map.zoom.init.y?[c.map.zoom.init.level,c.map.zoom.init.x,c.map.zoom.init.y]:[c.map.zoom.init.level],a.trigger("zoom",h));c.legend.area.slices&&c.legend.area.display&&(x=b.fn.mapael.createLegend(a,c,"area",k,1));a.on("update",function(g,h,p,q,l){var A=g=0,y=0,G={},G=function(a){"undefined"!=typeof a.hidden&&1==a.hidden&&b(a.node).trigger("click")};x.forEach&&x.forEach(G);m.forEach&&m.forEach(G);"undefined"!=
typeof l&&(l.resetAreas&&(c.areas={}),l.resetPlots&&(c.plots={}),l.animDuration&&(y=l.animDuration));b.extend(!0,c,h);if("object"==typeof q)for(;g<q.length;g++)"undefined"!=typeof n[q[g]]&&(0<y?function(a){a.mapElem.animate({opacity:0},y,"linear",function(){a.mapElem.remove()});a.textElem&&a.textElem.animate({opacity:0},y,"linear",function(){a.textElem.remove()})}(n[q[g]]):(n[q[g]].mapElem.remove(),n[q[g]].textElem&&n[q[g]].textElem.remove()),delete n[q[g]]);if("object"==typeof p)for(A in p)"undefined"==
typeof n[A]&&(c.plots[A]=p[A],n[A]=b.fn.mapael.drawPlot(A,c,e,f,d),0<y&&(n[A].mapElem.attr({opacity:0}),n[A].textElem.attr({opacity:0}),n[A].mapElem.animate({opacity:"undefined"!=typeof n[A].mapElem.originalAttrs.opacity?n[A].mapElem.originalAttrs.opacity:1},y),n[A].textElem.animate({opacity:"undefined"!=typeof n[A].textElem.originalAttrs.opacity?n[A].textElem.originalAttrs.opacity:1},y)));for(A in k)G=b.fn.mapael.getElemOptions(c.map.defaultArea,c.areas[A]?c.areas[A]:{},c.legend.area),b.fn.mapael.updateElem(G,
k[A],d,y);for(A in n)G=b.fn.mapael.getElemOptions(c.map.defaultPlot,c.plots[A]?c.plots[A]:{},c.legend.plot),"square"==G.type?(G.attrs.width=G.size,G.attrs.height=G.size,G.attrs.x=n[A].mapElem.attrs.x-(G.size-n[A].mapElem.attrs.width)/2,G.attrs.y=n[A].mapElem.attrs.y-(G.size-n[A].mapElem.attrs.height)/2):G.attrs.r=G.size/2,b.fn.mapael.updateElem(G,n[A],d,y);"undefined"!=typeof l&&l.afterUpdate&&l.afterUpdate(a,f,k,n,c)});if(c.map.width)f.setSize(c.map.width,c.map.width/e.width*e.height),c.legend.plot.slices&&
c.legend.plot.display&&(m=b.fn.mapael.createLegend(a,c,"plot",n,c.map.width/e.width));else{b(window).on("resize",function(){clearTimeout(l);l=setTimeout(function(){g.trigger("resizeEnd")},150)});var q=function(){c.legend.plot.slices&&c.legend.plot.display&&(m=b.fn.mapael.createLegend(a,c,"plot",n,g.width()/e.width));g.unbind("resizeEnd",q)};g.on("resizeEnd",function(){var a=g.width();f.width!=a&&f.setSize(a,a/e.width*e.height)}).on("resizeEnd",q).trigger("resizeEnd")}c.map.afterInit&&c.map.afterInit(a,
f,k,n,c);b(f.desc).append(" and Mapael (http://neveldo.fr/mapael)")})};b.fn.mapael.initElem=function(c,a,d,g,e){var f={},f={};b.fn.mapael.setHoverOptions(a.mapElem,d.attrs,d.attrsHover);d.text&&"undefined"!=typeof d.text.content?(f=a.mapElem.getBBox(),f=b.fn.mapael.getTextPosition(f,d.text.position,d.text.margin),d.text.attrs["text-anchor"]=f.textAnchor,a.textElem=c.text(f.x,f.y,d.text.content).attr(d.text.attrs),b.fn.mapael.setHoverOptions(a.textElem,d.text.attrs,d.text.attrsHover),b.fn.mapael.setHover(c,
a.mapElem,a.textElem),d.eventHandlers&&b.fn.mapael.setEventHandlers(e,d,a.mapElem,a.textElem),b(a.textElem.node).attr("data-id",e)):(b.fn.mapael.setHover(c,a.mapElem),d.eventHandlers&&b.fn.mapael.setEventHandlers(e,d,a.mapElem));d.tooltip&&d.tooltip.content&&(a.mapElem.tooltipContent=d.tooltip.content,b.fn.mapael.setTooltip(a.mapElem,g),d.text&&"undefined"!=typeof d.text.content&&(a.textElem.tooltipContent=d.tooltip.content,b.fn.mapael.setTooltip(a.textElem,g)));d.href&&(a.mapElem.href=d.href,a.mapElem.target=
d.target,b.fn.mapael.setHref(a.mapElem),d.text&&"undefined"!=typeof d.text.content&&(a.textElem.href=d.href,a.textElem.target=d.target,b.fn.mapael.setHref(a.textElem)));"undefined"!=typeof d.value&&(a.value=d.value);b(a.mapElem.node).attr("data-id",e)};b.fn.mapael.updateElem=function(c,a,d,g){var e,f;"undefined"!=typeof c.value&&(a.value=c.value);if(a.textElem){"undefined"!=typeof c.text&&"undefined"!=typeof c.text.content&&c.text.content!=a.textElem.attrs.text&&a.textElem.attr({text:c.text.content});
e=a.mapElem.getBBox();c.size&&(f=(c.size-e.height)/2,e.x-=f,e.x2+=f,e.y-=f,e.y2+=f);e=b.fn.mapael.getTextPosition(e,c.text.position,c.text.margin);if(e.x!=a.textElem.attrs.x||e.y!=a.textElem.attrs.y)0<g?(a.textElem.attr({"text-anchor":e.textAnchor}),a.textElem.animate({x:e.x,y:e.y},g)):a.textElem.attr({x:e.x,y:e.y,"text-anchor":e.textAnchor});b.fn.mapael.setHoverOptions(a.textElem,c.text.attrs,c.text.attrsHover);0<g?a.textElem.animate(c.text.attrs,g):a.textElem.attr(c.text.attrs)}b.fn.mapael.setHoverOptions(a.mapElem,
c.attrs,c.attrsHover);0<g?a.mapElem.animate(c.attrs,g):a.mapElem.attr(c.attrs);c.tooltip&&"undefined"!=typeof c.tooltip.content&&("undefined"==typeof a.mapElem.tooltipContent&&(b.fn.mapael.setTooltip(a.mapElem,d),a.textElem&&b.fn.mapael.setTooltip(a.textElem,d)),a.mapElem.tooltipContent=c.tooltip.content,a.textElem&&(a.textElem.tooltipContent=c.tooltip.content));"undefined"!=typeof c.href&&("undefined"==typeof a.mapElem.href&&(b.fn.mapael.setHref(a.mapElem),a.textElem&&b.fn.mapael.setHref(a.textElem)),
a.mapElem.href=c.href,a.mapElem.target=c.target,a.textElem&&(a.textElem.href=c.href,a.textElem.target=c.target))};b.fn.mapael.drawPlot=function(c,a,d,g,e){var f={},f={};a=b.fn.mapael.getElemOptions(a.map.defaultPlot,a.plots[c]?a.plots[c]:{},a.legend.plot);f=a.x&&a.y?{x:a.x,y:a.y}:d.getCoords(a.latitude,a.longitude);f="square"==a.type?{mapElem:g.rect(f.x-a.size/2,f.y-a.size/2,a.size,a.size).attr(a.attrs)}:{mapElem:g.circle(f.x,f.y,a.size/2).attr(a.attrs)};b.fn.mapael.initElem(g,f,a,e,c);return f};
b.fn.mapael.setHref=function(c){c.attr({cursor:"pointer"});b(c.node).bind("click",function(){!b.fn.mapael.panning&&c.href&&window.open(c.href,c.target)})};b.fn.mapael.setTooltip=function(c,a){var d=0,g=a.parent(),e=g.offset().left+g.width();b(c.node).on("mouseover",function(g){d=setTimeout(function(){c.tooltipContent&&a.html(c.tooltipContent).css("display","block");a.css({left:Math.min(e-a.outerWidth()-5,g.pageX+12),top:g.pageY+23-b(window).scrollTop()})},120)}).on("mouseout",function(b){clearTimeout(d);
a.css("display","none")}).on("mousemove",function(d){a.css({left:Math.min(e-a.outerWidth()-5,d.pageX+12),top:d.pageY+23-b(window).scrollTop()})})};b.fn.mapael.setEventHandlers=function(c,a,d,g){for(var e in a.eventHandlers)(function(e){b(d.node).on(e,function(h){!b.fn.mapael.panning&&a.eventHandlers[e](h,c,d,g)});g&&b(g.node).on(e,function(h){!b.fn.mapael.panning&&a.eventHandlers[e](h,c,d,g)})})(e)};b.fn.mapael.panning=!1;b.fn.mapael.initZoom=function(c,a,d,g,e){var f=c.parent(),h=b("<div>").addClass(e.zoomInCssClass).html("+"),
l=b("<div>").addClass(e.zoomOutCssClass).html("&#x2212;"),k=!1,n=0,x=0;f.data("zoomLevel",0);c.append(h).append(l);h.on("click",function(){f.trigger("zoom",f.data("zoomLevel")+1)});l.on("click",function(){f.trigger("zoom",f.data("zoomLevel")-1)});b("body").on("mouseup",function(a){k=!1;setTimeout(function(){b.fn.mapael.panning=!1},50)});c.on("mousedown",function(a){k=!0;n=a.pageX;x=a.pageY;return!1}).on("mousemove",function(c){var h=f.data("zoomLevel");if(k&&0!=h){var q=(n-c.pageX)/(1+h*e.step)*(d/
a.width),h=(x-c.pageY)/(1+h*e.step)*(g/a.height);if(5<Math.abs(q)||5<Math.abs(h))a.setViewBox(Math.min(Math.max(0,a._viewBox[0]+q),d-a._viewBox[2]),Math.min(Math.max(0,a._viewBox[1]+h),g-a._viewBox[3]),a._viewBox[2],a._viewBox[3]),n=c.pageX,x=c.pageY,b.fn.mapael.panning=!0}return!1})};b.fn.mapael.createLegend=function(c,a,d,g,e){var f=a.legend[d];c="plot"==d?b("."+a.legend.plot.cssClass,c).empty():b("."+a.legend.area.cssClass,c).empty();c=new Raphael(c.get(0));var h=5,l=5,k={},n={},n={},x={};f.title&&
(k=c.text(f.marginLeftTitle,f.marginBottom,f.title).attr(f.titleAttrs),h=f.marginLeftTitle+k.getBBox().width,l+=f.marginBottom+k.getBBox().height);for(var k=0,m=f.slices.length;k<m;++k)if("undefined"==typeof f.slices[k].display||1==f.slices[k].display)n="plot"==d?a.map.defaultPlot:a.map.defaultArea,f.slices[k].attrs=b.extend({},n.attrs,f.slices[k].attrs),f.slices[k].attrsHover=b.extend({},n.attrsHover,f.slices[k].attrsHover),"area"==d||"square"==f.slices[k].type?(!f.slices[k].size&&(f.slices[k].size=
20),n=c.rect(f.marginLeft,l,e*f.slices[k].size,e*f.slices[k].size).attr(f.slices[k].attrs)):n=c.circle(f.marginLeft+f.slices[k].size/2*e,l+f.slices[k].size/2*e,f.slices[k].size/2*e).attr(f.slices[k].attrs),x=c.text(f.marginLeft+e*f.slices[k].size+f.marginLeftLabel,l+f.slices[k].size/2*e,f.slices[k].label).attr(f.labelAttrs),l+=f.marginBottom+e*f.slices[k].size,h=Math.max(h,f.marginLeft+e*f.slices[k].size+f.marginLeftLabel+x.getBBox().width),f.hideElemsOnClick.enabled&&(x.attr({cursor:"pointer"}),
b.fn.mapael.setHoverOptions(n,f.slices[k].attrs,f.slices[k].attrs),b.fn.mapael.setHoverOptions(x,f.labelAttrs,f.labelAttrsHover),b.fn.mapael.setHover(c,n,x),x.hidden=!1,function(a,d,c){b(c.node).on("click",function(){c.hidden?c.animate({opacity:1},300):c.animate({opacity:.5},300);for(var b in g)("undefined"==typeof f.slices[a].min||g[b].value>=f.slices[a].min)&&("undefined"==typeof f.slices[a].max||g[b].value<f.slices[a].max)&&function(a){c.hidden?(0==f.hideElemsOnClick.opacity&&(g[a].mapElem.show(),
g[a].textElem&&g[a].textElem.show()),g[a].mapElem.animate({opacity:"undefined"!=typeof g[a].mapElem.originalAttrs.opacity?g[a].mapElem.originalAttrs.opacity:1},300),g[a].textElem&&g[a].textElem.animate({opacity:"undefined"!=typeof g[a].textElem.originalAttrs.opacity?g[a].textElem.originalAttrs.opacity:1},300)):(g[a].mapElem.animate({opacity:f.hideElemsOnClick.opacity},300,"linear",function(){0==f.hideElemsOnClick.opacity&&g[a].mapElem.hide()}),g[a].textElem&&g[a].textElem.animate({opacity:f.hideElemsOnClick.opacity},
300,"linear",function(){0==f.hideElemsOnClick.opacity&&g[a].textElem.hide()}))}(b);c.hidden=!c.hidden})}(k,n,x));"SVG"!=Raphael.type&&f.VMLWidth&&(h=f.VMLWidth);c.setSize(h,l);return c};b.fn.mapael.setHoverOptions=function(c,a,d){"SVG"!=Raphael.type&&delete d.transform;c.attrsHover=d;c.originalAttrs=c.attrsHover.transform?b.extend({transform:"s1"},a):a};b.fn.mapael.setHover=function(c,a,d){var g={},g={},e=0,f=function(){e=setTimeout(function(){b.fn.mapael.elemHover(c,a,d)},120)},h=function(){clearTimeout(e);
b.fn.mapael.elemOut(c,a,d)},g=b(a.node);g.on("mouseover",f);g.on("mouseout",h);d&&(g=b(d.node),g.on("mouseover",f),b(d.node).on("mouseout",h))};b.fn.mapael.elemHover=function(b,a,d){a.animate(a.attrsHover,a.attrsHover.animDuration);d&&d.animate(d.attrsHover,d.attrsHover.animDuration);b.safari()};b.fn.mapael.elemOut=function(b,a,d){a.animate(a.originalAttrs,a.attrsHover.animDuration);d&&d.animate(d.originalAttrs,d.attrsHover.animDuration);b.safari()};b.fn.mapael.getElemOptions=function(c,a,d){c=b.extend(!0,
{},c,a);"undefined"!=typeof c.value&&b.extend(!0,c,b.fn.mapael.getLegendSlice(c.value,d));return c};b.fn.mapael.getTextPosition=function(b,a,d){var g=0,e=0,f="";switch(a){case "bottom":g=(b.x+b.x2)/2;e=b.y2+d;f="middle";break;case "top":g=(b.x+b.x2)/2;e=b.y-d;f="middle";break;case "left":g=b.x-d;e=(b.y+b.y2)/2;f="end";break;case "right":g=b.x2+d;e=(b.y+b.y2)/2;f="start";break;default:g=(b.x+b.x2)/2,e=(b.y+b.y2)/2,f="middle"}return{x:g,y:e,textAnchor:f}};b.fn.mapael.getLegendSlice=function(b,a){for(var d=
0,g=a.slices.length;d<g;++d)if(("undefined"==typeof a.slices[d].min||b>=a.slices[d].min)&&("undefined"==typeof a.slices[d].max||b<a.slices[d].max))return a.slices[d];return{}};b.fn.mapael.defaultOptions={map:{cssClass:"map",tooltip:{cssClass:"mapTooltip"},defaultArea:{attrs:{fill:"#343434",stroke:"#5d5d5d","stroke-width":1,"stroke-linejoin":"round"},attrsHover:{fill:"#f38a03",animDuration:300},text:{position:"inner",margin:10,attrs:{"font-size":15,fill:"#c7c7c7"},attrsHover:{fill:"#eaeaea",animDuration:300}},
target:"_self"},defaultPlot:{type:"circle",size:15,attrs:{fill:"#0088db",stroke:"#fff","stroke-width":0,"stroke-linejoin":"round"},attrsHover:{"stroke-width":3,animDuration:300},text:{position:"right",margin:10,attrs:{"font-size":15,fill:"#c7c7c7"},attrsHover:{fill:"#eaeaea",animDuration:300}},target:"_self"},zoom:{enabled:!1,maxLevel:5,step:.25,zoomInCssClass:"zoomIn",zoomOutCssClass:"zoomOut"}},legend:{area:{cssClass:"areaLegend",display:!1,marginLeft:15,marginLeftTitle:5,marginLeftLabel:10,marginBottom:15,
titleAttrs:{"font-size":18,fill:"#343434","text-anchor":"start"},labelAttrs:{"font-size":15,fill:"#343434","text-anchor":"start"},labelAttrsHover:{fill:"#787878",animDuration:300},hideElemsOnClick:{enabled:!0,opacity:.2},slices:[]},plot:{cssClass:"plotLegend",display:!1,marginLeft:15,marginLeftTitle:5,marginLeftLabel:10,marginBottom:15,titleAttrs:{"font-size":18,fill:"#343434","text-anchor":"start"},labelAttrs:{"font-size":15,fill:"#343434","text-anchor":"start"},labelAttrsHover:{fill:"#787878",animDuration:300},
hideElemsOnClick:{enabled:!0,opacity:.2},slices:[]}},areas:{},plots:{}}})(jQuery);
!function(b){var c=function(a,g){this.$element=b(a);this.options=b.extend({},c.defaults,g)};c.defaults={transition_delay:300,refresh_speed:50,display_text:"none",use_percentage:!0,percent_format:function(a){return a+"%"},amount_format:function(a,b){return a+" / "+b},update:b.noop,done:b.noop,fail:b.noop};c.prototype.transition=function(){var a=this.$element,g=a.parent(),e=this.$back_text,f=this.$front_text,h=this.options,l=parseInt(a.attr("data-transitiongoal")),k=parseInt(a.attr("aria-valuemin"))||
0,n=parseInt(a.attr("aria-valuemax"))||100,x=g.hasClass("vertical"),m=h.update&&"function"==typeof h.update?h.update:c.defaults.update,p=h.done&&"function"==typeof h.done?h.done:c.defaults.done,q=h.fail&&"function"==typeof h.fail?h.fail:c.defaults.fail;if(isNaN(l))return void q("data-transitiongoal not set");var D=Math.round(100*(l-k)/(n-k));if("center"===h.display_text&&!e&&!f){this.$back_text=e=b("<span>").addClass("progressbar-back-text").prependTo(g);this.$front_text=f=b("<span>").addClass("progressbar-front-text").prependTo(a);
var H;x?(H=g.css("height"),e.css({height:H,"line-height":H}),f.css({height:H,"line-height":H}),b(window).resize(function(){H=g.css("height");e.css({height:H,"line-height":H});f.css({height:H,"line-height":H})})):(H=g.css("width"),f.css({width:H}),b(window).resize(function(){H=g.css("width");f.css({width:H})}))}setTimeout(function(){var b,c,q,H,y;x?a.css("height",D+"%"):a.css("width",D+"%");var G=setInterval(function(){x?(q=a.height(),H=g.height()):(q=a.width(),H=g.width());b=Math.round(100*q/H);c=
Math.round(k+q/H*(n-k));b>=D&&(b=D,c=l,p(a),clearInterval(G));"none"!==h.display_text&&(y=h.use_percentage?h.percent_format(b):h.amount_format(c,n,k),"fill"===h.display_text?a.text(y):"center"===h.display_text&&(e.text(y),f.text(y)));a.attr("aria-valuenow",c);m(b,a)},h.refresh_speed)},h.transition_delay)};var a=b.fn.progressbar;b.fn.progressbar=function(a){return this.each(function(){var g=b(this),e=g.data("bs.progressbar"),f="object"==typeof a&&a;e||g.data("bs.progressbar",e=new c(this,f));e.transition()})};
b.fn.progressbar.Constructor=c;b.fn.progressbar.noConflict=function(){return b.fn.progressbar=a,this}}(window.jQuery);
!function(b){function c(a,b){return function(d){return l(a.call(this,d),b)}}function a(a,b){return function(d){return this.lang().ordinal(a.call(this,d),b)}}function d(){}function g(a){f(this,a)}function e(a){var b=a.years||a.year||a.y||0,d=a.months||a.month||a.M||0,c=a.weeks||a.week||a.w||0,e=a.days||a.day||a.d||0,g=a.hours||a.hour||a.h||0,f=a.minutes||a.minute||a.m||0,m=a.seconds||a.second||a.s||0,h=a.milliseconds||a.millisecond||a.ms||0;this._input=a;this._milliseconds=h+1E3*m+6E4*f+36E5*g;this._days=
e+7*c;this._months=d+12*b;this._data={};this._bubble()}function f(a,b){for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);return a}function h(a){return 0>a?Math.ceil(a):Math.floor(a)}function l(a,b){for(var d=a+"";d.length<b;)d="0"+d;return d}function k(a,b,d,c){var e,g,f=b._milliseconds,m=b._days;b=b._months;f&&a._d.setTime(+a._d+f*d);(m||b)&&(e=a.minute(),g=a.hour());m&&a.date(a.date()+m*d);b&&a.month(a.month()+b*d);f&&!c&&B.updateOffset(a);(m||b)&&(a.minute(e),a.hour(g))}function n(a,b){var d,c=Math.min(a.length,
b.length),e=Math.abs(a.length-b.length),g=0;for(d=0;c>d;d++)~~a[d]!==~~b[d]&&g++;return g+e}function x(a){return a?S[a]||a.toLowerCase().replace(/(.)s$/,"$1"):a}function m(a){if(!a)return B.fn._lang;if(!W[a]&&ca)try{require("./lang/"+a)}catch(b){return B.fn._lang}return W[a]}function p(a){return a.match(/\[.*\]/)?a.replace(/^\[|\]$/g,""):a.replace(/\\/g,"")}function q(a){var b,d,c=a.match(aa);b=0;for(d=c.length;d>b;b++)c[b]=M[c[b]]?M[c[b]]:p(c[b]);return function(e){var g="";for(b=0;d>b;b++)g+=c[b]instanceof
Function?c[b].call(e,a):c[b];return g}}function D(a,b){function d(b){return a.lang().longDateFormat(b)||b}for(var c=5;c--&&X.test(b);)b=b.replace(X,d);return C[b]||(C[b]=q(b)),C[b](a)}function H(a,b){switch(a){case "DDDD":return ga;case "YYYY":return ja;case "YYYYY":return ka;case "S":case "SS":case "SSS":case "DDD":return ha;case "MMM":case "MMMM":case "dd":case "ddd":case "dddd":return da;case "a":case "A":return m(b._l)._meridiemParse;case "X":return N;case "Z":case "ZZ":return I;case "T":return v;
case "MM":case "DD":case "YY":case "HH":case "hh":case "mm":case "ss":case "M":case "D":case "d":case "H":case "h":case "m":case "s":return ia;default:return new RegExp(a.replace("\\",""))}}function J(a){a=((I.exec(a)||[])[0]+"").match(w)||["-",0,0];var b=+(60*a[1])+~~a[2];return"+"===a[0]?-b:b}function L(a){var b,d=[];if(!a._d){for(b=0;7>b;b++)a._a[b]=d[b]=null==a._a[b]?2===b?1:0:a._a[b];d[3]+=~~((a._tzm||0)/60);d[4]+=~~((a._tzm||0)%60);b=new Date(0);a._useUTC?(b.setUTCFullYear(d[0],d[1],d[2]),b.setUTCHours(d[3],
d[4],d[5],d[6])):(b.setFullYear(d[0],d[1],d[2]),b.setHours(d[3],d[4],d[5],d[6]));a._d=b}}function z(a){var b,d,c=a._f.match(aa),e=a._i;a._a=[];for(b=0;b<c.length;b++)if((d=(H(c[b],a).exec(e)||[])[0])&&(e=e.slice(e.indexOf(d)+d.length)),M[c[b]]){var g=a,f=void 0,h=g._a;switch(c[b]){case "M":case "MM":h[1]=null==d?0:~~d-1;break;case "MMM":case "MMMM":f=m(g._l).monthsParse(d);null!=f?h[1]=f:g._isValid=!1;break;case "D":case "DD":case "DDD":case "DDDD":null!=d&&(h[2]=~~d);break;case "YY":h[0]=~~d+(68<
~~d?1900:2E3);break;case "YYYY":case "YYYYY":h[0]=~~d;break;case "a":case "A":g._isPm=m(g._l).isPM(d);break;case "H":case "HH":case "h":case "hh":h[3]=~~d;break;case "m":case "mm":h[4]=~~d;break;case "s":case "ss":h[5]=~~d;break;case "S":case "SS":case "SSS":h[6]=~~(1E3*("0."+d));break;case "X":g._d=new Date(1E3*parseFloat(d));break;case "Z":case "ZZ":g._useUTC=!0,g._tzm=J(d)}null==d&&(g._isValid=!1)}e&&(a._il=e);a._isPm&&12>a._a[3]&&(a._a[3]+=12);!1===a._isPm&&12===a._a[3]&&(a._a[3]=0);L(a)}function A(a,
b,d,c,e){return e.relativeTime(b||1,!!d,a,c)}function y(a,b,d){var c;b=d-b;d-=a.day();return d>b&&(d-=7),b-7>d&&(d+=7),c=B(a).add("d",d),{week:Math.ceil(c.dayOfYear()/7),year:c.year()}}function G(a){var d=a._i,c=a._f;if(null===d||""===d)a=null;else{"string"==typeof d&&(a._i=d=m().preparse(d));if(B.isMoment(d))a=f({},d),a._d=new Date(+d._d);else if(c)if("[object Array]"===Object.prototype.toString.call(c)){var d=a,e,h,p,q=99;for(p=0;p<d._f.length;p++)e=f({},d),e._f=d._f[p],z(e),c=new g(e),e=n(e._a,
c.toArray()),c._il&&(e+=c._il.length),q>e&&(q=e,h=c);f(d,h)}else z(a);else if(h=a,d=h._i,c=ea.exec(d),d===b)h._d=new Date;else if(c)h._d=new Date(+c[1]);else if("string"==typeof d)if(d=h._i,c=Y.exec(d)){h._f="YYYY-MM-DD"+(c[2]||" ");for(c=0;4>c;c++)if(U[c][1].exec(d)){h._f+=U[c][0];break}I.exec(d)&&(h._f+=" Z");z(h)}else h._d=new Date(d);else"[object Array]"===Object.prototype.toString.call(d)?(h._a=d.slice(0),L(h)):h._d=d instanceof Date?new Date(+d):new Date(d);a=new g(a)}return a}function K(a,
b){B.fn[a]=B.fn[a+"s"]=function(a){var d=this._isUTC?"UTC":"";return null!=a?(this._d["set"+d+b](a),B.updateOffset(this),this):this._d["get"+d+b]()}}function ba(a){B.duration.fn[a]=function(){return this._data[a]}}function Z(a,b){B.duration.fn["as"+a]=function(){return+this/b}}for(var B,O,V=Math.round,W={},ca="undefined"!=typeof module&&module.exports,ea=/^\/?Date\((\-?\d+)/i,fa=/(\-)?(\d*)?\.?(\d+)\:(\d+)\:(\d+)\.?(\d{3})?/,aa=/(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|SS?S?|X|zz?|ZZ?|.)/g,
X=/(\[[^\[]*\])|(\\)?(LT|LL?L?L?|l{1,4})/g,ia=/\d\d?/,ha=/\d{1,3}/,ga=/\d{3}/,ja=/\d{1,4}/,ka=/[+\-]?\d{1,6}/,da=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,I=/Z|[\+\-]\d\d:?\d\d/i,v=/T/i,N=/[\+\-]?\d+(\.\d{1,3})?/,Y=/^\s*\d{4}-\d\d-\d\d((T| )(\d\d(:\d\d(:\d\d(\.\d\d?\d?)?)?)?)?([\+\-]\d\d:?\d\d)?)?/,U=[["HH:mm:ss.S",/(T| )\d\d:\d\d:\d\d\.\d{1,3}/],["HH:mm:ss",/(T| )\d\d:\d\d:\d\d/],["HH:mm",/(T| )\d\d:\d\d/],["HH",/(T| )\d\d/]],
w=/([\+\-]|\d\d)/gi,Q=["Date","Hours","Minutes","Seconds","Milliseconds"],P={Milliseconds:1,Seconds:1E3,Minutes:6E4,Hours:36E5,Days:864E5,Months:2592E6,Years:31536E6},S={ms:"millisecond",s:"second",m:"minute",h:"hour",d:"day",w:"week",M:"month",y:"year"},C={},T="DDD w W M D d".split(" "),R="MDHhmswW".split(""),M={M:function(){return this.month()+1},MMM:function(a){return this.lang().monthsShort(this,a)},MMMM:function(a){return this.lang().months(this,a)},D:function(){return this.date()},DDD:function(){return this.dayOfYear()},
d:function(){return this.day()},dd:function(a){return this.lang().weekdaysMin(this,a)},ddd:function(a){return this.lang().weekdaysShort(this,a)},dddd:function(a){return this.lang().weekdays(this,a)},w:function(){return this.week()},W:function(){return this.isoWeek()},YY:function(){return l(this.year()%100,2)},YYYY:function(){return l(this.year(),4)},YYYYY:function(){return l(this.year(),5)},gg:function(){return l(this.weekYear()%100,2)},gggg:function(){return this.weekYear()},ggggg:function(){return l(this.weekYear(),
5)},GG:function(){return l(this.isoWeekYear()%100,2)},GGGG:function(){return this.isoWeekYear()},GGGGG:function(){return l(this.isoWeekYear(),5)},e:function(){return this.weekday()},E:function(){return this.isoWeekday()},a:function(){return this.lang().meridiem(this.hours(),this.minutes(),!0)},A:function(){return this.lang().meridiem(this.hours(),this.minutes(),!1)},H:function(){return this.hours()},h:function(){return this.hours()%12||12},m:function(){return this.minutes()},s:function(){return this.seconds()},
S:function(){return~~(this.milliseconds()/100)},SS:function(){return l(~~(this.milliseconds()/10),2)},SSS:function(){return l(this.milliseconds(),3)},Z:function(){var a=-this.zone(),b="+";return 0>a&&(a=-a,b="-"),b+l(~~(a/60),2)+":"+l(~~a%60,2)},ZZ:function(){var a=-this.zone(),b="+";return 0>a&&(a=-a,b="-"),b+l(~~(10*a/6),4)},z:function(){return this.zoneAbbr()},zz:function(){return this.zoneName()},X:function(){return this.unix()}};T.length;)O=T.pop(),M[O+"o"]=a(M[O],O);for(;R.length;)O=R.pop(),
M[O+O]=c(M[O],2);M.DDDD=c(M.DDD,3);d.prototype={set:function(a){var b,d;for(d in a)b=a[d],"function"==typeof b?this[d]=b:this["_"+d]=b},_months:"January February March April May June July August September October November December".split(" "),months:function(a){return this._months[a.month()]},_monthsShort:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),monthsShort:function(a){return this._monthsShort[a.month()]},monthsParse:function(a){var b,d,c;this._monthsParse||(this._monthsParse=
[]);for(b=0;12>b;b++)if(this._monthsParse[b]||(d=B([2E3,b]),c="^"+this.months(d,"")+"|^"+this.monthsShort(d,""),this._monthsParse[b]=new RegExp(c.replace(".",""),"i")),this._monthsParse[b].test(a))return b},_weekdays:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),weekdays:function(a){return this._weekdays[a.day()]},_weekdaysShort:"Sun Mon Tue Wed Thu Fri Sat".split(" "),weekdaysShort:function(a){return this._weekdaysShort[a.day()]},_weekdaysMin:"Su Mo Tu We Th Fr Sa".split(" "),
weekdaysMin:function(a){return this._weekdaysMin[a.day()]},weekdaysParse:function(a){var b,d,c;this._weekdaysParse||(this._weekdaysParse=[]);for(b=0;7>b;b++)if(this._weekdaysParse[b]||(d=B([2E3,1]).day(b),c="^"+this.weekdays(d,"")+"|^"+this.weekdaysShort(d,"")+"|^"+this.weekdaysMin(d,""),this._weekdaysParse[b]=new RegExp(c.replace(".",""),"i")),this._weekdaysParse[b].test(a))return b},_longDateFormat:{LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D YYYY",LLL:"MMMM D YYYY LT",LLLL:"dddd, MMMM D YYYY LT"},longDateFormat:function(a){var b=
this._longDateFormat[a];return!b&&this._longDateFormat[a.toUpperCase()]&&(b=this._longDateFormat[a.toUpperCase()].replace(/MMMM|MM|DD|dddd/g,function(a){return a.slice(1)}),this._longDateFormat[a]=b),b},isPM:function(a){return"p"===(a+"").toLowerCase()[0]},_meridiemParse:/[ap]\.?m?\.?/i,meridiem:function(a,b,d){return 11<a?d?"pm":"PM":d?"am":"AM"},_calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},
calendar:function(a,b){var d=this._calendar[a];return"function"==typeof d?d.apply(b):d},_relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},relativeTime:function(a,b,d,c){var e=this._relativeTime[d];return"function"==typeof e?e(a,b,d,c):e.replace(/%d/i,a)},pastFuture:function(a,b){var d=this._relativeTime[0<a?"future":"past"];return"function"==typeof d?d(b):
d.replace(/%s/i,b)},ordinal:function(a){return this._ordinal.replace("%d",a)},_ordinal:"%d",preparse:function(a){return a},postformat:function(a){return a},week:function(a){return y(a,this._week.dow,this._week.doy).week},_week:{dow:0,doy:6}};B=function(a,b,d){return G({_i:a,_f:b,_l:d,_isUTC:!1})};B.utc=function(a,b,d){return G({_useUTC:!0,_isUTC:!0,_l:d,_i:a,_f:b})};B.unix=function(a){return B(1E3*a)};B.duration=function(a,b){var d,c,g=B.isDuration(a),f="number"==typeof a,m=g?a._input:f?{}:a,h=fa.exec(a);
return f?b?m[b]=a:m.milliseconds=a:h&&(d="-"===h[1]?-1:1,m={y:0,d:~~h[2]*d,h:~~h[3]*d,m:~~h[4]*d,s:~~h[5]*d,ms:~~h[6]*d}),c=new e(m),g&&a.hasOwnProperty("_lang")&&(c._lang=a._lang),c};B.version="2.1.0";B.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";B.updateOffset=function(){};B.lang=function(a,b){var c;a?(b?(b.abbr=a,W[a]||(W[a]=new d),W[a].set(b)):W[a]||m(a),c=(B.duration.fn._lang=B.fn._lang=m(a),void 0)):c=B.fn._lang._abbr;return c};B.langData=function(a){return a&&a._lang&&a._lang._abbr&&(a=a._lang._abbr),
m(a)};B.isMoment=function(a){return a instanceof g};B.isDuration=function(a){return a instanceof e};B.fn=g.prototype={clone:function(){return B(this)},valueOf:function(){return+this._d+6E4*(this._offset||0)},unix:function(){return Math.floor(+this/1E3)},toString:function(){return this.format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},toDate:function(){return this._offset?new Date(+this):this._d},toISOString:function(){return D(B(this).utc(),"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]")},toArray:function(){return[this.year(),
this.month(),this.date(),this.hours(),this.minutes(),this.seconds(),this.milliseconds()]},isValid:function(){return null==this._isValid&&(this._isValid=this._a?!n(this._a,(this._isUTC?B.utc(this._a):B(this._a)).toArray()):!isNaN(this._d.getTime())),!!this._isValid},utc:function(){return this.zone(0)},local:function(){return this.zone(0),this._isUTC=!1,this},format:function(a){a=D(this,a||B.defaultFormat);return this.lang().postformat(a)},add:function(a,b){var d;return d="string"==typeof a?B.duration(+b,
a):B.duration(a,b),k(this,d,1),this},subtract:function(a,b){var d;return d="string"==typeof a?B.duration(+b,a):B.duration(a,b),k(this,d,-1),this},diff:function(a,b,d){var c,e;a=this._isUTC?B(a).zone(this._offset||0):B(a).local();var g=6E4*(this.zone()-a.zone());return b=x(b),"year"===b||"month"===b?(c=432E5*(this.daysInMonth()+a.daysInMonth()),e=12*(this.year()-a.year())+(this.month()-a.month()),e+=(this-B(this).startOf("month")-(a-B(a).startOf("month")))/c,e-=6E4*(this.zone()-B(this).startOf("month").zone()-
(a.zone()-B(a).startOf("month").zone()))/c,"year"===b&&(e/=12)):(c=this-a,e="second"===b?c/1E3:"minute"===b?c/6E4:"hour"===b?c/36E5:"day"===b?(c-g)/864E5:"week"===b?(c-g)/6048E5:c),d?e:h(e)},from:function(a,b){return B.duration(this.diff(a)).lang(this.lang()._abbr).humanize(!b)},fromNow:function(a){return this.from(B(),a)},calendar:function(){var a=this.diff(B().startOf("day"),"days",!0),a=-6>a?"sameElse":-1>a?"lastWeek":0>a?"lastDay":1>a?"sameDay":2>a?"nextDay":7>a?"nextWeek":"sameElse";return this.format(this.lang().calendar(a,
this))},isLeapYear:function(){var a=this.year();return 0===a%4&&0!==a%100||0===a%400},isDST:function(){return this.zone()<this.clone().month(0).zone()||this.zone()<this.clone().month(5).zone()},day:function(a){var b=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=a?"string"==typeof a&&(a=this.lang().weekdaysParse(a),"number"!=typeof a)?this:this.add({d:a-b}):b},month:function(a){var b,d=this._isUTC?"UTC":"";return null!=a?"string"==typeof a&&(a=this.lang().monthsParse(a),"number"!=typeof a)?
this:(b=this.date(),this.date(1),this._d["set"+d+"Month"](a),this.date(Math.min(b,this.daysInMonth())),B.updateOffset(this),this):this._d["get"+d+"Month"]()},startOf:function(a){switch(a=x(a)){case "year":this.month(0);case "month":this.date(1);case "week":case "day":this.hours(0);case "hour":this.minutes(0);case "minute":this.seconds(0);case "second":this.milliseconds(0)}return"week"===a&&this.weekday(0),this},endOf:function(a){return this.startOf(a).add(a,1).subtract("ms",1)},isAfter:function(a,
b){return b="undefined"!=typeof b?b:"millisecond",+this.clone().startOf(b)>+B(a).startOf(b)},isBefore:function(a,b){return b="undefined"!=typeof b?b:"millisecond",+this.clone().startOf(b)<+B(a).startOf(b)},isSame:function(a,b){return b="undefined"!=typeof b?b:"millisecond",+this.clone().startOf(b)===+B(a).startOf(b)},min:function(a){return a=B.apply(null,arguments),this>a?this:a},max:function(a){return a=B.apply(null,arguments),a>this?this:a},zone:function(a){var b=this._offset||0;return null==a?
this._isUTC?b:this._d.getTimezoneOffset():("string"==typeof a&&(a=J(a)),16>Math.abs(a)&&(a*=60),this._offset=a,this._isUTC=!0,b!==a&&k(this,B.duration(b-a,"m"),1,!0),this)},zoneAbbr:function(){return this._isUTC?"UTC":""},zoneName:function(){return this._isUTC?"Coordinated Universal Time":""},daysInMonth:function(){return B.utc([this.year(),this.month()+1,0]).date()},dayOfYear:function(a){var b=V((B(this).startOf("day")-B(this).startOf("year"))/864E5)+1;return null==a?b:this.add("d",a-b)},weekYear:function(a){var b=
y(this,this.lang()._week.dow,this.lang()._week.doy).year;return null==a?b:this.add("y",a-b)},isoWeekYear:function(a){var b=y(this,1,4).year;return null==a?b:this.add("y",a-b)},week:function(a){var b=this.lang().week(this);return null==a?b:this.add("d",7*(a-b))},isoWeek:function(a){var b=y(this,1,4).week;return null==a?b:this.add("d",7*(a-b))},weekday:function(a){var b=(this._d.getDay()+7-this.lang()._week.dow)%7;return null==a?b:this.add("d",a-b)},isoWeekday:function(a){return null==a?this.day()||
7:this.day(this.day()%7?a:a-7)},lang:function(a){return a===b?this._lang:(this._lang=m(a),this)}};for(O=0;O<Q.length;O++)K(Q[O].toLowerCase().replace(/s$/,""),Q[O]);K("year","FullYear");B.fn.days=B.fn.day;B.fn.months=B.fn.month;B.fn.weeks=B.fn.week;B.fn.isoWeeks=B.fn.isoWeek;B.fn.toJSON=B.fn.toISOString;B.duration.fn=e.prototype={_bubble:function(){var a,b;a=this._milliseconds;b=this._days;var d=this._months,c=this._data;c.milliseconds=a%1E3;a=h(a/1E3);c.seconds=a%60;a=h(a/60);c.minutes=a%60;a=h(a/
60);c.hours=a%24;b+=h(a/24);c.days=b%30;d+=h(b/30);c.months=d%12;b=h(d/12);c.years=b},weeks:function(){return h(this.days()/7)},valueOf:function(){return this._milliseconds+864E5*this._days+this._months%12*2592E6+31536E6*~~(this._months/12)},humanize:function(a){var b=+this,d;d=!a;var c=this.lang(),e=V(Math.abs(b)/1E3),g=V(e/60),f=V(g/60),m=V(f/24),h=V(m/365),e=45>e&&["s",e]||1===g&&["m"]||45>g&&["mm",g]||1===f&&["h"]||22>f&&["hh",f]||1===m&&["d"]||25>=m&&["dd",m]||45>=m&&["M"]||345>m&&["MM",V(m/
30)]||1===h&&["y"]||["yy",h];d=(e[2]=d,e[3]=0<b,e[4]=c,A.apply({},e));return a&&(d=this.lang().pastFuture(b,d)),this.lang().postformat(d)},add:function(a,b){var d=B.duration(a,b);return this._milliseconds+=d._milliseconds,this._days+=d._days,this._months+=d._months,this._bubble(),this},subtract:function(a,b){var d=B.duration(a,b);return this._milliseconds-=d._milliseconds,this._days-=d._days,this._months-=d._months,this._bubble(),this},get:function(a){return a=x(a),this[a.toLowerCase()+"s"]()},as:function(a){return a=
x(a),this["as"+a.charAt(0).toUpperCase()+a.slice(1)+"s"]()},lang:B.fn.lang};for(O in P)P.hasOwnProperty(O)&&(Z(O,P[O]),ba(O.toLowerCase()));Z("Weeks",6048E5);B.duration.fn.asMonths=function(){return(+this-31536E6*this.years())/2592E6+12*this.years()};B.lang("en",{ordinal:function(a){var b=a%10;return a+(1===~~(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th")}});ca&&(module.exports=B);"undefined"==typeof ender&&(this.moment=B);"function"==typeof define&&define.amd&&define("moment",[],function(){return B})}.call(this);
!function(b){var c=function(a,d){this.options=b.extend({},b.fn.editableform.defaults,d);this.$div=b(a);this.options.scope||(this.options.scope=this)};c.prototype={constructor:c,initInput:function(){this.input=this.options.input;this.value=this.input.str2value(this.options.value);this.input.prerender()},initTemplate:function(){this.$form=b(b.fn.editableform.template)},initButtons:function(){var a=this.$form.find(".editable-buttons");a.append(b.fn.editableform.buttons);"bottom"===this.options.showbuttons&&
a.addClass("editable-buttons-bottom")},render:function(){this.$loading=b(b.fn.editableform.loading);this.$div.empty().append(this.$loading);this.initTemplate();this.options.showbuttons?this.initButtons():this.$form.find(".editable-buttons").remove();this.showLoading();this.isSaving=!1;this.$div.triggerHandler("rendering");this.initInput();this.$form.find("div.editable-input").append(this.input.$tpl);this.$div.append(this.$form);b.when(this.input.render()).then(b.proxy(function(){(this.options.showbuttons||
this.input.autosubmit(),this.$form.find(".editable-cancel").click(b.proxy(this.cancel,this)),this.input.error)?(this.error(this.input.error),this.$form.find(".editable-submit").attr("disabled",!0),this.input.$input.attr("disabled",!0),this.$form.submit(function(a){a.preventDefault()})):(this.error(!1),this.input.$input.removeAttr("disabled"),this.$form.find(".editable-submit").removeAttr("disabled"),this.input.value2input(null===this.value||void 0===this.value||""===this.value?this.options.defaultValue:
this.value),this.$form.submit(b.proxy(this.submit,this)));this.$div.triggerHandler("rendered");this.showForm();this.input.postrender&&this.input.postrender()},this))},cancel:function(){this.$div.triggerHandler("cancel")},showLoading:function(){var a,b;this.$form?(a=this.$form.outerWidth(),b=this.$form.outerHeight(),a&&this.$loading.width(a),b&&this.$loading.height(b),this.$form.hide()):(a=this.$loading.parent().width(),a&&this.$loading.width(a));this.$loading.show()},showForm:function(a){this.$loading.hide();
this.$form.show();!1!==a&&this.input.activate();this.$div.triggerHandler("show")},error:function(a){var d=this.$form.find(".control-group"),c=this.$form.find(".editable-error-block");if(!1===a)d.removeClass(b.fn.editableform.errorGroupClass),c.removeClass(b.fn.editableform.errorBlockClass).empty().hide();else{if(a){a=(""+a).split("\n");for(var e=0;e<a.length;e++)a[e]=b("<div>").text(a[e]).html();a=a.join("<br>")}d.addClass(b.fn.editableform.errorGroupClass);c.addClass(b.fn.editableform.errorBlockClass).html(a).show()}},
submit:function(a){a.stopPropagation();a.preventDefault();var d=this.input.input2value();a=this.validate(d);if("object"===b.type(a)&&void 0!==a.newValue){if(d=a.newValue,this.input.value2input(d),"string"==typeof a.msg)return this.error(a.msg),this.showForm(),void 0}else if(a)return this.error(a),this.showForm(),void 0;if(!this.options.savenochange&&this.input.value2str(d)==this.input.value2str(this.value))return this.$div.triggerHandler("nochange"),void 0;var c=this.input.value2submit(d);this.isSaving=
!0;b.when(this.save(c)).done(b.proxy(function(a){this.isSaving=!1;var b="function"==typeof this.options.success?this.options.success.call(this.options.scope,a,d):null;return!1===b?(this.error(!1),this.showForm(!1),void 0):"string"==typeof b?(this.error(b),this.showForm(),void 0):(b&&"object"==typeof b&&b.hasOwnProperty("newValue")&&(d=b.newValue),this.error(!1),this.value=d,this.$div.triggerHandler("save",{newValue:d,submitValue:c,response:a}),void 0)},this)).fail(b.proxy(function(a){this.isSaving=
!1;a="function"==typeof this.options.error?this.options.error.call(this.options.scope,a,d):"string"==typeof a?a:a.responseText||a.statusText||"Unknown error!";this.error(a);this.showForm()},this))},save:function(a){this.options.pk=b.fn.editableutils.tryParseJson(this.options.pk,!0);var d,c="function"==typeof this.options.pk?this.options.pk.call(this.options.scope):this.options.pk;return"function"==typeof this.options.url||this.options.url&&("always"===this.options.send||"auto"===this.options.send&&
null!==c&&void 0!==c)?(this.showLoading(),d={name:this.options.name||"",value:a,pk:c},"function"==typeof this.options.params?d=this.options.params.call(this.options.scope,d):(this.options.params=b.fn.editableutils.tryParseJson(this.options.params,!0),b.extend(d,this.options.params)),"function"==typeof this.options.url?this.options.url.call(this.options.scope,d):b.ajax(b.extend({url:this.options.url,data:d,type:"POST"},this.options.ajaxOptions))):void 0},validate:function(a){return void 0===a&&(a=
this.value),"function"==typeof this.options.validate?this.options.validate.call(this.options.scope,a):void 0},option:function(a,b){a in this.options&&(this.options[a]=b);"value"===a&&this.setValue(b)},setValue:function(a,b){this.value=b?this.input.str2value(a):a;this.$form&&this.$form.is(":visible")&&this.input.value2input(this.value)}};b.fn.editableform=function(a){var d=arguments;return this.each(function(){var g=b(this),e=g.data("editableform"),f="object"==typeof a&&a;e||g.data("editableform",
e=new c(this,f));"string"==typeof a&&e[a].apply(e,Array.prototype.slice.call(d,1))})};b.fn.editableform.Constructor=c;b.fn.editableform.defaults={type:"text",url:null,params:null,name:null,pk:null,value:null,defaultValue:null,send:"auto",validate:null,success:null,error:null,ajaxOptions:null,showbuttons:!0,scope:null,savenochange:!1};b.fn.editableform.template='<form class="form-inline editableform"><div class="control-group"><div><div class="editable-input"></div><div class="editable-buttons"></div></div><div class="editable-error-block"></div></div></form>';
b.fn.editableform.loading='<div class="editableform-loading"></div>';b.fn.editableform.buttons='<button type="submit" class="editable-submit">ok</button><button type="button" class="editable-cancel">cancel</button>';b.fn.editableform.errorGroupClass=null;b.fn.editableform.errorBlockClass="editable-error";b.fn.editableform.engine="jquery"}(window.jQuery);
(function(b){b.fn.editableutils={inherit:function(b,a){var d=function(){};d.prototype=a.prototype;b.prototype=new d;b.prototype.constructor=b;b.superclass=a.prototype},setCursorPosition:function(b,a){if(b.setSelectionRange)b.setSelectionRange(a,a);else if(b.createTextRange){var d=b.createTextRange();d.collapse(!0);d.moveEnd("character",a);d.moveStart("character",a);d.select()}},tryParseJson:function(b,a){if("string"==typeof b&&b.length&&b.match(/^[\{\[].*[\}\]]$/))if(a)try{b=(new Function("return "+
b))()}catch(d){}finally{}else b=(new Function("return "+b))();return b},sliceObj:function(c,a,d){var g,e,f={};if(!b.isArray(a)||!a.length)return f;for(var h=0;h<a.length;h++)g=a[h],c.hasOwnProperty(g)&&(f[g]=c[g]),!0!==d&&(e=g.toLowerCase(),c.hasOwnProperty(e)&&(f[g]=c[e]));return f},getConfigData:function(c){var a={};return b.each(c.data(),function(b,c){("object"!=typeof c||c&&"object"==typeof c&&(c.constructor===Object||c.constructor===Array))&&(a[b]=c)}),a},objectKeys:function(b){if(Object.keys)return Object.keys(b);
if(b!==Object(b))throw new TypeError("Object.keys called on a non-object");var a,d=[];for(a in b)Object.prototype.hasOwnProperty.call(b,a)&&d.push(a);return d},escape:function(c){return b("<div>").text(c).html()},itemsByValue:function(c,a,d){if(!a||null===c)return[];if("function"!=typeof d){var g=d||"value";d=function(a){return a[g]}}var e=b.isArray(c),f=[],h=this;return b.each(a,function(a,g){if(g.children)f=f.concat(h.itemsByValue(c,g.children,d));else if(e)b.grep(c,function(a){return a==(g&&"object"==
typeof g?d(g):g)}).length&&f.push(g);else{var n=g&&"object"==typeof g?d(g):g;c==n&&f.push(g)}}),f},createInput:function(c){var a,d,g=c.type;return"date"===g&&("inline"===c.mode?b.fn.editabletypes.datefield?g="datefield":b.fn.editabletypes.dateuifield&&(g="dateuifield"):b.fn.editabletypes.date?g="date":b.fn.editabletypes.dateui&&(g="dateui"),"date"!==g||b.fn.editabletypes.date||(g="combodate")),"datetime"===g&&"inline"===c.mode&&(g="datetimefield"),"wysihtml5"!==g||b.fn.editabletypes[g]||(g="textarea"),
"function"==typeof b.fn.editabletypes[g]?(a=b.fn.editabletypes[g],d=this.sliceObj(c,this.objectKeys(a.defaults)),new a(d)):(b.error("Unknown type: "+g),!1)},supportsTransitions:function(){var b=(document.body||document.documentElement).style,a="transition",d=["Moz","Webkit","Khtml","O","ms"];if("string"==typeof b[a])return!0;for(var a=a.charAt(0).toUpperCase()+a.substr(1),g=0;g<d.length;g++)if("string"==typeof b[d[g]+a])return!0;return!1}}})(window.jQuery);
(function(b){var c=function(a,b){this.init(a,b)},a=function(a,b){this.init(a,b)};c.prototype={containerName:null,containerDataName:null,innerCss:null,containerClass:"editable-container editable-popup",defaults:{},init:function(a,g){this.$element=b(a);this.options=b.extend({},b.fn.editableContainer.defaults,g);this.splitOptions();this.formOptions.scope=this.$element[0];this.initContainer();this.delayedHide=!1;this.$element.on("destroyed",b.proxy(function(){this.destroy()},this));b(document).data("editable-handlers-attached")||
(b(document).on("keyup.editable",function(a){27===a.which&&b(".editable-open").editableContainer("hide")}),b(document).on("click.editable",function(a){var d,g=b(a.target),l=".editable-container .ui-datepicker-header .datepicker .modal-backdrop .bootstrap-wysihtml5-insert-image-modal .bootstrap-wysihtml5-insert-link-modal".split(" ");if(b.contains(document.documentElement,a.target)&&!g.is(document)){for(d=0;d<l.length;d++)if(g.is(l[d])||g.parents(l[d]).length)return;c.prototype.closeOthers(a.target)}}),
b(document).data("editable-handlers-attached",!0))},splitOptions:function(){if(this.containerOptions={},this.formOptions={},!b.fn[this.containerName])throw Error(this.containerName+" not found. Have you included corresponding js file?");for(var a in this.options)a in this.defaults?this.containerOptions[a]=this.options[a]:this.formOptions[a]=this.options[a]},tip:function(){return this.container()?this.container().$tip:null},container:function(){var a;return this.containerDataName&&(a=this.$element.data(this.containerDataName))?
a:this.$element.data(this.containerName)},call:function(){this.$element[this.containerName].apply(this.$element,arguments)},initContainer:function(){this.call(this.containerOptions)},renderForm:function(){this.$form.editableform(this.formOptions).on({save:b.proxy(this.save,this),nochange:b.proxy(function(){this.hide("nochange")},this),cancel:b.proxy(function(){this.hide("cancel")},this),show:b.proxy(function(){this.delayedHide?(this.hide(this.delayedHide.reason),this.delayedHide=!1):this.setPosition()},
this),rendering:b.proxy(this.setPosition,this),resize:b.proxy(this.setPosition,this),rendered:b.proxy(function(){this.$element.triggerHandler("shown",b(this.options.scope).data("editable"))},this)}).editableform("render")},show:function(a){this.$element.addClass("editable-open");!1!==a&&this.closeOthers(this.$element[0]);this.innerShow();this.tip().addClass(this.containerClass);this.$form;this.$form=b("<div>");this.tip().is(this.innerCss)?this.tip().append(this.$form):this.tip().find(this.innerCss).append(this.$form);
this.renderForm()},hide:function(a){if(this.tip()&&this.tip().is(":visible")&&this.$element.hasClass("editable-open")){if(this.$form.data("editableform").isSaving)return this.delayedHide={reason:a},void 0;this.delayedHide=!1;this.$element.removeClass("editable-open");this.innerHide();this.$element.triggerHandler("hidden",a||"manual")}},innerShow:function(){},innerHide:function(){},toggle:function(a){this.container()&&this.tip()&&this.tip().is(":visible")?this.hide():this.show(a)},setPosition:function(){},
save:function(a,b){this.$element.triggerHandler("save",b);this.hide("save")},option:function(a,b){this.options[a]=b;a in this.containerOptions?(this.containerOptions[a]=b,this.setContainerOption(a,b)):(this.formOptions[a]=b,this.$form&&this.$form.editableform("option",a,b))},setContainerOption:function(a,b){this.call("option",a,b)},destroy:function(){this.hide();this.innerDestroy();this.$element.off("destroyed");this.$element.removeData("editableContainer")},innerDestroy:function(){},closeOthers:function(a){b(".editable-open").each(function(c,
e){if(e!==a&&!b(e).find(a).length){var f=b(e),h=f.data("editableContainer");h&&("cancel"===h.options.onblur?f.data("editableContainer").hide("onblur"):"submit"===h.options.onblur&&f.data("editableContainer").tip().find("form").submit())}})},activate:function(){this.tip&&this.tip().is(":visible")&&this.$form&&this.$form.data("editableform").input.activate()}};b.fn.editableContainer=function(d){var g=arguments;return this.each(function(){var e=b(this),f=e.data("editableContainer"),h="object"==typeof d&&
d,l="inline"===h.mode?a:c;f||e.data("editableContainer",f=new l(this,h));"string"==typeof d&&f[d].apply(f,Array.prototype.slice.call(g,1))})};b.fn.editableContainer.Popup=c;b.fn.editableContainer.Inline=a;b.fn.editableContainer.defaults={value:null,placement:"top",autohide:!0,onblur:"cancel",anim:!1,mode:"popup"};jQuery.event.special.destroyed={remove:function(a){a.handler&&a.handler()}}})(window.jQuery);
(function(b){b.extend(b.fn.editableContainer.Inline.prototype,b.fn.editableContainer.Popup.prototype,{containerName:"editableform",innerCss:".editable-inline",containerClass:"editable-container editable-inline",initContainer:function(){this.$tip=b("<span></span>");this.options.anim||(this.options.anim=0)},splitOptions:function(){this.containerOptions={};this.formOptions=this.options},tip:function(){return this.$tip},innerShow:function(){this.$element.hide();this.tip().insertAfter(this.$element).show()},
innerHide:function(){this.$tip.hide(this.options.anim,b.proxy(function(){this.$element.show();this.innerDestroy()},this))},innerDestroy:function(){this.tip()&&this.tip().empty().remove()}})})(window.jQuery);
(function(b){var c=function(a,d){this.$element=b(a);this.options=b.extend({},b.fn.editable.defaults,d,b.fn.editableutils.getConfigData(this.$element));this.options.selector?this.initLive():this.init();this.options.highlight&&!b.fn.editableutils.supportsTransitions()&&(this.options.highlight=!1)};c.prototype={constructor:c,init:function(){var a;a=!1;if(this.options.name=this.options.name||this.$element.attr("id"),this.options.scope=this.$element[0],this.input=b.fn.editableutils.createInput(this.options),
this.input){switch(void 0===this.options.value||null===this.options.value?(this.value=this.input.html2value(b.trim(this.$element.html())),a=!0):(this.options.value=b.fn.editableutils.tryParseJson(this.options.value,!0),this.value="string"==typeof this.options.value?this.input.str2value(this.options.value):this.options.value),this.$element.addClass("editable"),"textarea"===this.input.type&&this.$element.addClass("editable-pre-wrapped"),"manual"!==this.options.toggle?(this.$element.addClass("editable-click"),
this.$element.on(this.options.toggle+".editable",b.proxy(function(a){(this.options.disabled||a.preventDefault(),"mouseenter"===this.options.toggle)?this.show():this.toggle("click"!==this.options.toggle)},this))):this.$element.attr("tabindex",-1),"function"==typeof this.options.display&&(this.options.autotext="always"),this.options.autotext){case "always":a=!0;break;case "auto":a=!b.trim(this.$element.text()).length&&null!==this.value&&void 0!==this.value&&!a;break;default:a=!1}b.when(a?this.render():
!0).then(b.proxy(function(){this.options.disabled?this.disable():this.enable();this.$element.triggerHandler("init",this)},this))}},initLive:function(){var a=this.options.selector;this.options.selector=!1;this.options.autotext="never";this.$element.on(this.options.toggle+".editable",a,b.proxy(function(a){var c=b(a.target);c.data("editable")||(c.hasClass(this.options.emptyclass)&&c.empty(),c.editable(this.options).trigger(a))},this))},render:function(a){return!1!==this.options.display?this.input.value2htmlFinal?
this.input.value2html(this.value,this.$element[0],this.options.display,a):"function"==typeof this.options.display?this.options.display.call(this.$element[0],this.value,a):this.input.value2html(this.value,this.$element[0]):void 0},enable:function(){this.options.disabled=!1;this.$element.removeClass("editable-disabled");this.handleEmpty(this.isEmpty);"manual"!==this.options.toggle&&"-1"===this.$element.attr("tabindex")&&this.$element.removeAttr("tabindex")},disable:function(){this.options.disabled=
!0;this.hide();this.$element.addClass("editable-disabled");this.handleEmpty(this.isEmpty);this.$element.attr("tabindex",-1)},toggleDisabled:function(){this.options.disabled?this.enable():this.disable()},option:function(a,d){return a&&"object"==typeof a?(b.each(a,b.proxy(function(a,d){this.option(b.trim(a),d)},this)),void 0):(this.options[a]=d,"disabled"===a?d?this.disable():this.enable():("value"===a&&this.setValue(d),this.container&&this.container.option(a,d),this.input.option&&this.input.option(a,
d),void 0))},handleEmpty:function(a){!1!==this.options.display&&(this.isEmpty=void 0!==a?a:"function"==typeof this.input.isEmpty?this.input.isEmpty(this.$element):""===b.trim(this.$element.html()),this.options.disabled?this.isEmpty&&(this.$element.empty(),this.options.emptyclass&&this.$element.removeClass(this.options.emptyclass)):this.isEmpty?(this.$element.html(this.options.emptytext),this.options.emptyclass&&this.$element.addClass(this.options.emptyclass)):this.options.emptyclass&&this.$element.removeClass(this.options.emptyclass))},
show:function(a){if(!this.options.disabled){if(this.container){if(this.container.tip().is(":visible"))return}else{var d=b.extend({},this.options,{value:this.value,input:this.input});this.$element.editableContainer(d);this.$element.on("save.internal",b.proxy(this.save,this));this.container=this.$element.data("editableContainer")}this.container.show(a)}},hide:function(){this.container&&this.container.hide()},toggle:function(a){this.container&&this.container.tip().is(":visible")?this.hide():this.show(a)},
save:function(a,b){if(this.options.unsavedclass){var c;(c=(c=(c=(c="function"==typeof this.options.url)||!1===this.options.display)||void 0!==b.response)||this.options.savenochange&&this.input.value2str(this.value)!==this.input.value2str(b.newValue))?this.$element.removeClass(this.options.unsavedclass):this.$element.addClass(this.options.unsavedclass)}if(this.options.highlight){var e=this.$element,f=e.css("background-color");e.css("background-color",this.options.highlight);setTimeout(function(){"transparent"===
f&&(f="");e.css("background-color",f);e.addClass("editable-bg-transition");setTimeout(function(){e.removeClass("editable-bg-transition")},1700)},10)}this.setValue(b.newValue,!1,b.response)},validate:function(){return"function"==typeof this.options.validate?this.options.validate.call(this,this.value):void 0},setValue:function(a,d,c){this.value=d?this.input.str2value(a):a;this.container&&this.container.option("value",this.value);b.when(this.render(c)).then(b.proxy(function(){this.handleEmpty()},this))},
activate:function(){this.container&&this.container.activate()},destroy:function(){this.disable();this.container&&this.container.destroy();this.input.destroy();"manual"!==this.options.toggle&&(this.$element.removeClass("editable-click"),this.$element.off(this.options.toggle+".editable"));this.$element.off("save.internal");this.$element.removeClass("editable editable-open editable-disabled");this.$element.removeData("editable")}};b.fn.editable=function(a){var d={},g=arguments;switch(a){case "validate":return this.each(function(){var a,
c=b(this).data("editable");c&&(a=c.validate())&&(d[c.options.name]=a)}),d;case "getValue":return 2===arguments.length&&!0===arguments[1]?d=this.eq(0).data("editable").value:this.each(function(){var a=b(this).data("editable");a&&void 0!==a.value&&null!==a.value&&(d[a.options.name]=a.input.value2submit(a.value))}),d;case "submit":var e=arguments[1]||{},f=this,h=this.editable("validate");if(b.isEmptyObject(h)){var l={};1===f.length?(h=f.data("editable"),l={name:h.options.name||"",value:h.input.value2submit(h.value),
pk:"function"==typeof h.options.pk?h.options.pk.call(h.options.scope):h.options.pk},"function"==typeof h.options.params?l=h.options.params.call(h.options.scope,l):(h.options.params=b.fn.editableutils.tryParseJson(h.options.params,!0),b.extend(l,h.options.params)),l={url:h.options.url,data:l,type:"POST"},e.success=e.success||h.options.success,e.error=e.error||h.options.error):(h=this.editable("getValue"),l={url:e.url,data:h,type:"POST"});l.success="function"==typeof e.success?function(a){e.success.call(f,
a,e)}:b.noop;l.error="function"==typeof e.error?function(){e.error.apply(f,arguments)}:b.noop;e.ajaxOptions&&b.extend(l,e.ajaxOptions);e.data&&b.extend(l.data,e.data);b.ajax(l)}else"function"==typeof e.error&&e.error.call(f,h);return this}return this.each(function(){var d=b(this),e=d.data("editable"),f="object"==typeof a&&a;return f&&f.selector?(new c(this,f),void 0):(e||d.data("editable",e=new c(this,f)),"string"==typeof a&&e[a].apply(e,Array.prototype.slice.call(g,1)),void 0)})};b.fn.editable.defaults=
{type:"text",disabled:!1,toggle:"click",emptytext:"Empty",autotext:"auto",value:null,display:null,emptyclass:"editable-empty",unsavedclass:"editable-unsaved",selector:null,highlight:"#FFFF80"}})(window.jQuery);
(function(b){b.fn.editabletypes={};var c=function(){};c.prototype={init:function(a,d,c){this.type=a;this.options=b.extend({},c,d)},prerender:function(){this.$input=this.$tpl=b(this.options.tpl);this.error=this.$clear=null},render:function(){},value2html:function(a,d){b(d)[this.options.escape?"text":"html"](b.trim(a))},html2value:function(a){return b("<div>").html(a).text()},value2str:function(a){return a},str2value:function(a){return a},value2submit:function(a){return a},value2input:function(a){this.$input.val(a)},
input2value:function(){return this.$input.val()},activate:function(){this.$input.is(":visible")&&this.$input.focus()},clear:function(){this.$input.val(null)},escape:function(a){return b("<div>").text(a).html()},autosubmit:function(){},destroy:function(){},setClass:function(){this.options.inputclass&&this.$input.addClass(this.options.inputclass)},setAttr:function(a){void 0!==this.options[a]&&null!==this.options[a]&&this.$input.attr(a,this.options[a])},option:function(a,b){this.options[a]=b}};c.defaults=
{tpl:"",inputclass:null,escape:!0,scope:null,showbuttons:!0};b.extend(b.fn.editabletypes,{abstractinput:c})})(window.jQuery);
(function(b){var c=function(){};b.fn.editableutils.inherit(c,b.fn.editabletypes.abstractinput);b.extend(c.prototype,{render:function(){var a=b.Deferred();return this.error=null,this.onSourceReady(function(){this.renderList();a.resolve()},function(){this.error=this.options.sourceError;a.resolve()}),a.promise()},html2value:function(){return null},value2html:function(a,d,c,e){var f=b.Deferred(),h=function(){"function"==typeof c?c.call(d,a,this.sourceData,e):this.value2htmlFinal(a,d);f.resolve()};return null===
a?h.call(this):this.onSourceReady(h,function(){f.resolve()}),f.promise()},onSourceReady:function(a,d){var c;if(b.isFunction(this.options.source)?(c=this.options.source.call(this.options.scope),this.sourceData=null):c=this.options.source,this.options.sourceCache&&b.isArray(this.sourceData))return a.call(this),void 0;try{c=b.fn.editableutils.tryParseJson(c,!1)}catch(h){return d.call(this),void 0}if("string"==typeof c){if(this.options.sourceCache){var e,f=c;if(b(document).data(f)||b(document).data(f,
{}),e=b(document).data(f),!1===e.loading&&e.sourceData)return this.sourceData=e.sourceData,this.doPrepend(),a.call(this),void 0;if(!0===e.loading)return e.callbacks.push(b.proxy(function(){this.sourceData=e.sourceData;this.doPrepend();a.call(this)},this)),e.err_callbacks.push(b.proxy(d,this)),void 0;e.loading=!0;e.callbacks=[];e.err_callbacks=[]}c=b.extend({url:c,type:"get",cache:!1,dataType:"json",success:b.proxy(function(c){e&&(e.loading=!1);this.sourceData=this.makeArray(c);b.isArray(this.sourceData)?
(e&&(e.sourceData=this.sourceData,b.each(e.callbacks,function(){this.call()})),this.doPrepend(),a.call(this)):(d.call(this),e&&b.each(e.err_callbacks,function(){this.call()}))},this),error:b.proxy(function(){d.call(this);e&&(e.loading=!1,b.each(e.err_callbacks,function(){this.call()}))},this)},this.options.sourceOptions);b.ajax(c)}else this.sourceData=this.makeArray(c),b.isArray(this.sourceData)?(this.doPrepend(),a.call(this)):d.call(this)},doPrepend:function(){null!==this.options.prepend&&void 0!==
this.options.prepend&&(b.isArray(this.prependData)||(b.isFunction(this.options.prepend)&&(this.options.prepend=this.options.prepend.call(this.options.scope)),this.options.prepend=b.fn.editableutils.tryParseJson(this.options.prepend,!0),"string"==typeof this.options.prepend&&(this.options.prepend={"":this.options.prepend}),this.prependData=this.makeArray(this.options.prepend)),b.isArray(this.prependData)&&b.isArray(this.sourceData)&&(this.sourceData=this.prependData.concat(this.sourceData)))},renderList:function(){},
value2htmlFinal:function(){},makeArray:function(a){var d,c,e,f,h=[];if(!a||"string"==typeof a)return null;if(b.isArray(a)){f=function(a,b){return c={value:a,text:b},2<=d++?!1:void 0};for(var l=0;l<a.length;l++)e=a[l],"object"==typeof e?(d=0,b.each(e,f),1===d?h.push(c):1<d&&(e.children&&(e.children=this.makeArray(e.children)),h.push(e))):h.push({value:e,text:e})}else b.each(a,function(a,b){h.push({value:a,text:b})});return h},option:function(a,b){this.options[a]=b;"source"===a&&(this.sourceData=null);
"prepend"===a&&(this.prependData=null)}});c.defaults=b.extend({},b.fn.editabletypes.abstractinput.defaults,{source:null,prepend:!1,sourceError:"Error when loading list",sourceCache:!0,sourceOptions:null});b.fn.editabletypes.list=c})(window.jQuery);
(function(b){var c=function(a){this.init("text",a,c.defaults)};b.fn.editableutils.inherit(c,b.fn.editabletypes.abstractinput);b.extend(c.prototype,{render:function(){this.renderClear();this.setClass();this.setAttr("placeholder")},activate:function(){this.$input.is(":visible")&&(this.$input.focus(),b.fn.editableutils.setCursorPosition(this.$input.get(0),this.$input.val().length),this.toggleClear&&this.toggleClear())},renderClear:function(){this.options.clear&&(this.$clear=b('<span class="editable-clear-x"></span>'),
this.$input.after(this.$clear).css("padding-right",24).keyup(b.proxy(function(a){if(!~b.inArray(a.keyCode,[40,38,9,13,27])){clearTimeout(this.t);var d=this;this.t=setTimeout(function(){d.toggleClear(a)},100)}},this)).parent().css("position","relative"),this.$clear.click(b.proxy(this.clear,this)))},postrender:function(){},toggleClear:function(){if(this.$clear){var a=this.$input.val().length,b=this.$clear.is(":visible");a&&!b&&this.$clear.show();!a&&b&&this.$clear.hide()}},clear:function(){this.$clear.hide();
this.$input.val("").focus()}});c.defaults=b.extend({},b.fn.editabletypes.abstractinput.defaults,{tpl:'<input type="text">',placeholder:null,clear:!0});b.fn.editabletypes.text=c})(window.jQuery);
(function(b){var c=function(a){this.init("textarea",a,c.defaults)};b.fn.editableutils.inherit(c,b.fn.editabletypes.abstractinput);b.extend(c.prototype,{render:function(){this.setClass();this.setAttr("placeholder");this.setAttr("rows");this.$input.keydown(function(a){a.ctrlKey&&13===a.which&&b(this).closest("form").submit()})},activate:function(){b.fn.editabletypes.text.prototype.activate.call(this)}});c.defaults=b.extend({},b.fn.editabletypes.abstractinput.defaults,{tpl:"<textarea></textarea>",inputclass:"input-large",
placeholder:null,rows:7});b.fn.editabletypes.textarea=c})(window.jQuery);
(function(b){var c=function(a){this.init("select",a,c.defaults)};b.fn.editableutils.inherit(c,b.fn.editabletypes.list);b.extend(c.prototype,{renderList:function(){this.$input.empty();var a=function(d,c){var e;if(b.isArray(c))for(var f=0;f<c.length;f++)e={},c[f].children?(e.label=c[f].text,d.append(a(b("<optgroup>",e),c[f].children))):(e.value=c[f].value,c[f].disabled&&(e.disabled=!0),d.append(b("<option>",e).text(c[f].text)));return d};a(this.$input,this.sourceData);this.setClass();this.$input.on("keydown.editable",
function(a){13===a.which&&b(this).closest("form").submit()})},value2htmlFinal:function(a,d){var c="",e=b.fn.editableutils.itemsByValue(a,this.sourceData);e.length&&(c=e[0].text);b.fn.editabletypes.abstractinput.prototype.value2html.call(this,c,d)},autosubmit:function(){this.$input.off("keydown.editable").on("change.editable",function(){b(this).closest("form").submit()})}});c.defaults=b.extend({},b.fn.editabletypes.list.defaults,{tpl:"<select></select>"});b.fn.editabletypes.select=c})(window.jQuery);
(function(b){var c=function(a){this.init("checklist",a,c.defaults)};b.fn.editableutils.inherit(c,b.fn.editabletypes.list);b.extend(c.prototype,{renderList:function(){var a;if(this.$tpl.empty(),b.isArray(this.sourceData)){for(var d=0;d<this.sourceData.length;d++)a=b("<label>").append(b("<input>",{type:"checkbox",value:this.sourceData[d].value})).append(b("<span>").text(" "+this.sourceData[d].text)),b("<div>").append(a).appendTo(this.$tpl);this.$input=this.$tpl.find('input[type="checkbox"]');this.setClass()}},
value2str:function(a){return b.isArray(a)?a.sort().join(b.trim(this.options.separator)):""},str2value:function(a){var d,c=null;return"string"==typeof a&&a.length?(d=new RegExp("\\s*"+b.trim(this.options.separator)+"\\s*"),c=a.split(d)):c=b.isArray(a)?a:[a],c},value2input:function(a){this.$input.prop("checked",!1);b.isArray(a)&&a.length&&this.$input.each(function(d,c){var e=b(c);b.each(a,function(a,b){e.val()==b&&e.prop("checked",!0)})})},input2value:function(){var a=[];return this.$input.filter(":checked").each(function(d,
c){a.push(b(c).val())}),a},value2htmlFinal:function(a,d){var c=[],e=b.fn.editableutils.itemsByValue(a,this.sourceData),f=this.options.escape;e.length?(b.each(e,function(a,d){var e=f?b.fn.editableutils.escape(d.text):d.text;c.push(e)}),b(d).html(c.join("<br>"))):b(d).empty()},activate:function(){this.$input.first().focus()},autosubmit:function(){this.$input.on("keydown",function(a){13===a.which&&b(this).closest("form").submit()})}});c.defaults=b.extend({},b.fn.editabletypes.list.defaults,{tpl:'<div class="editable-checklist"></div>',
inputclass:null,separator:","});b.fn.editabletypes.checklist=c})(window.jQuery);(function(b){var c=function(a){this.init("password",a,c.defaults)};b.fn.editableutils.inherit(c,b.fn.editabletypes.text);b.extend(c.prototype,{value2html:function(a,d){a?b(d).text("[hidden]"):b(d).empty()},html2value:function(){return null}});c.defaults=b.extend({},b.fn.editabletypes.text.defaults,{tpl:'<input type="password">'});b.fn.editabletypes.password=c})(window.jQuery);
(function(b){var c=function(a){this.init("email",a,c.defaults)};b.fn.editableutils.inherit(c,b.fn.editabletypes.text);c.defaults=b.extend({},b.fn.editabletypes.text.defaults,{tpl:'<input type="email">'});b.fn.editabletypes.email=c})(window.jQuery);(function(b){var c=function(a){this.init("url",a,c.defaults)};b.fn.editableutils.inherit(c,b.fn.editabletypes.text);c.defaults=b.extend({},b.fn.editabletypes.text.defaults,{tpl:'<input type="url">'});b.fn.editabletypes.url=c})(window.jQuery);
(function(b){var c=function(a){this.init("tel",a,c.defaults)};b.fn.editableutils.inherit(c,b.fn.editabletypes.text);c.defaults=b.extend({},b.fn.editabletypes.text.defaults,{tpl:'<input type="tel">'});b.fn.editabletypes.tel=c})(window.jQuery);
(function(b){var c=function(a){this.init("number",a,c.defaults)};b.fn.editableutils.inherit(c,b.fn.editabletypes.text);b.extend(c.prototype,{render:function(){c.superclass.render.call(this);this.setAttr("min");this.setAttr("max");this.setAttr("step")},postrender:function(){this.$clear&&this.$clear.css({right:24})}});c.defaults=b.extend({},b.fn.editabletypes.text.defaults,{tpl:'<input type="number">',inputclass:"input-mini",min:null,max:null,step:null});b.fn.editabletypes.number=c})(window.jQuery);
(function(b){var c=function(a){this.init("range",a,c.defaults)};b.fn.editableutils.inherit(c,b.fn.editabletypes.number);b.extend(c.prototype,{render:function(){this.$input=this.$tpl.filter("input");this.setClass();this.setAttr("min");this.setAttr("max");this.setAttr("step");this.$input.on("input",function(){b(this).siblings("output").text(b(this).val())})},activate:function(){this.$input.focus()}});c.defaults=b.extend({},b.fn.editabletypes.number.defaults,{tpl:'<input type="range"><output style="width: 30px; display: inline-block"></output>',
inputclass:"input-medium"});b.fn.editabletypes.range=c})(window.jQuery);(function(b){var c=function(a){this.init("time",a,c.defaults)};b.fn.editableutils.inherit(c,b.fn.editabletypes.abstractinput);b.extend(c.prototype,{render:function(){this.setClass()}});c.defaults=b.extend({},b.fn.editabletypes.abstractinput.defaults,{tpl:'<input type="time">'});b.fn.editabletypes.time=c})(window.jQuery);
(function(b){var c=function(a){if(this.init("select2",a,c.defaults),a.select2=a.select2||{},this.sourceData=null,a.placeholder&&(a.select2.placeholder=a.placeholder),!a.select2.tags&&a.source){var d=a.source;b.isFunction(a.source)&&(d=a.source.call(a.scope));"string"==typeof d?(a.select2.ajax=a.select2.ajax||{},a.select2.ajax.data||(a.select2.ajax.data=function(a){return{query:a}}),a.select2.ajax.results||(a.select2.ajax.results=function(a){return{results:a}}),a.select2.ajax.url=d):(this.sourceData=
this.convertSource(d),a.select2.data=this.sourceData)}if(this.options.select2=b.extend({},c.defaults.select2,a.select2),this.isMultiple=this.options.select2.tags||this.options.select2.multiple,this.isRemote="ajax"in this.options.select2,this.idFunc=this.options.select2.id,"function"!=typeof this.idFunc){var g=this.idFunc||"id";this.idFunc=function(a){return a[g]}}this.formatSelection=this.options.select2.formatSelection;"function"!=typeof this.formatSelection&&(this.formatSelection=function(a){return a.text})};
b.fn.editableutils.inherit(c,b.fn.editabletypes.abstractinput);b.extend(c.prototype,{render:function(){this.setClass();this.isRemote&&this.$input.on("select2-loaded",b.proxy(function(a){this.sourceData=a.items.results},this));this.isMultiple&&this.$input.on("change",function(){b(this).closest("form").parent().triggerHandler("resize")})},value2html:function(a,d){var g,e="",f=this;this.options.select2.tags?g=a:this.sourceData&&(g=b.fn.editableutils.itemsByValue(a,this.sourceData,this.idFunc));b.isArray(g)?
(e=[],b.each(g,function(a,b){e.push(b&&"object"==typeof b?f.formatSelection(b):b)})):g&&(e=f.formatSelection(g));e=b.isArray(e)?e.join(this.options.viewseparator):e;c.superclass.value2html.call(this,e,d)},html2value:function(a){return this.options.select2.tags?this.str2value(a,this.options.viewseparator):null},value2input:function(a){if(b.isArray(a)&&(a=a.join(this.getSeparator())),this.$input.data("select2")?this.$input.val(a).trigger("change",!0):(this.$input.val(a),this.$input.select2(this.options.select2)),
this.isRemote&&!this.isMultiple&&!this.options.select2.initSelection){var d=this.options.select2.formatSelection;this.options.select2.id||d||(d=b(this.options.scope),d.data("editable").isEmpty||(a={id:a,text:d.text()},this.$input.select2("data",a)))}},input2value:function(){return this.$input.select2("val")},str2value:function(a,d){if("string"!=typeof a||!this.isMultiple)return a;d=d||this.getSeparator();var c,e,f;if(null===a||1>a.length)return null;c=a.split(d);e=0;for(f=c.length;f>e;e+=1)c[e]=b.trim(c[e]);
return c},autosubmit:function(){this.$input.on("change",function(a,d){d||b(this).closest("form").submit()})},getSeparator:function(){return this.options.select2.separator||b.fn.select2.defaults.separator},convertSource:function(a){if(b.isArray(a)&&a.length&&void 0!==a[0].value)for(var d=0;d<a.length;d++)void 0!==a[d].value&&(a[d].id=a[d].value,delete a[d].value);return a},destroy:function(){this.$input.data("select2")&&this.$input.select2("destroy")}});c.defaults=b.extend({},b.fn.editabletypes.abstractinput.defaults,
{tpl:'<input type="hidden">',select2:null,placeholder:null,source:null,viewseparator:", "});b.fn.editabletypes.select2=c})(window.jQuery);
(function(b){var c=function(a,d){return this.$element=b(a),this.$element.is("input")?(this.options=b.extend({},b.fn.combodate.defaults,d,this.$element.data()),this.init(),void 0):(b.error("Combodate should be applied to INPUT element"),void 0)};c.prototype={constructor:c,init:function(){this.map={day:["D","date"],month:["M","month"],year:["Y","year"],hour:["[Hh]","hours"],minute:["m","minutes"],second:["s","seconds"],ampm:["[Aa]",""]};this.$widget=b('<span class="combodate"></span>').html(this.getTemplate());
this.initCombos();this.$widget.on("change","select",b.proxy(function(a){this.$element.val(this.getValue()).change();this.options.smartDays&&(b(a.target).is(".month")||b(a.target).is(".year"))&&this.fillCombo("day")},this));this.$widget.find("select").css("width","auto");this.$element.hide().after(this.$widget);this.setValue(this.$element.val()||this.options.value)},getTemplate:function(){var a=this.options.template;return b.each(this.map,function(b,c){c=c[0];var e=new RegExp(c+"+"),f=1<c.length?c.substring(1,
2):c;a=a.replace(e,"{"+f+"}")}),a=a.replace(/ /g,"&nbsp;"),b.each(this.map,function(b,c){c=c[0];var e=1<c.length?c.substring(1,2):c;a=a.replace("{"+e+"}",'<select class="'+b+'"></select>')}),a},initCombos:function(){for(var a in this.map){var b=this.$widget.find("."+a);this["$"+a]=b.length?b:null;this.fillCombo(a)}},fillCombo:function(a){var b=this["$"+a];if(b){a=this["fill"+a.charAt(0).toUpperCase()+a.slice(1)]();var c=b.val();b.empty();for(var e=0;e<a.length;e++)b.append('<option value="'+a[e][0]+
'">'+a[e][1]+"</option>");b.val(c)}},fillCommon:function(a){var b,c=[];"name"===this.options.firstItem?(b=moment.relativeTime||moment.langData()._relativeTime,a="function"==typeof b[a]?b[a](1,!0,a,!1):b[a],a=a.split(" ").reverse()[0],c.push(["",a])):"empty"===this.options.firstItem&&c.push(["",""]);return c},fillDay:function(){var a,b,c=this.fillCommon("d"),e=-1!==this.options.template.indexOf("DD"),f=31;this.options.smartDays&&this.$month&&this.$year&&(a=parseInt(this.$month.val(),10),b=parseInt(this.$year.val(),
10),isNaN(a)||isNaN(b)||(f=moment([b,a]).daysInMonth()));for(b=1;f>=b;b++)a=e?this.leadZero(b):b,c.push([b,a]);return c},fillMonth:function(){var a,b,c=this.fillCommon("M"),e=-1!==this.options.template.indexOf("MMMM"),f=-1!==this.options.template.indexOf("MMM"),h=-1!==this.options.template.indexOf("MM");for(b=0;11>=b;b++)a=e?moment().date(1).month(b).format("MMMM"):f?moment().date(1).month(b).format("MMM"):h?this.leadZero(b+1):b+1,c.push([b,a]);return c},fillYear:function(){var a,b,c=[],e=-1!==this.options.template.indexOf("YYYY");
for(b=this.options.maxYear;b>=this.options.minYear;b--)a=e?b:(b+"").substring(2),c[this.options.yearDescending?"push":"unshift"]([b,a]);return this.fillCommon("y").concat(c)},fillHour:function(){var a,b,c=this.fillCommon("h");a=-1!==this.options.template.indexOf("h");var e=(-1!==this.options.template.indexOf("H"),-1!==this.options.template.toLowerCase().indexOf("hh")),f=a?12:23;for(b=a?1:0;f>=b;b++)a=e?this.leadZero(b):b,c.push([b,a]);return c},fillMinute:function(){var a,b,c=this.fillCommon("m"),
e=-1!==this.options.template.indexOf("mm");for(b=0;59>=b;b+=this.options.minuteStep)a=e?this.leadZero(b):b,c.push([b,a]);return c},fillSecond:function(){var a,b,c=this.fillCommon("s"),e=-1!==this.options.template.indexOf("ss");for(b=0;59>=b;b+=this.options.secondStep)a=e?this.leadZero(b):b,c.push([b,a]);return c},fillAmpm:function(){var a=-1!==this.options.template.indexOf("a");return-1!==this.options.template.indexOf("A"),[["am",a?"am":"AM"],["pm",a?"pm":"PM"]]},getValue:function(a){var d,c={},e=
this,f=!1;return b.each(this.map,function(a){if("ampm"!==a){var b="day"===a?1:0;return c[a]=e["$"+a]?parseInt(e["$"+a].val(),10):b,isNaN(c[a])?(f=!0,!1):void 0}}),f?"":(this.$ampm&&(c.hour=12===c.hour?"am"===this.$ampm.val()?0:12:"am"===this.$ampm.val()?c.hour:c.hour+12),d=moment([c.year,c.month,c.day,c.hour,c.minute,c.second]),this.highlight(d),a=void 0===a?this.options.format:a,null===a?d.isValid()?d:null:d.isValid()?d.format(a):"")},setValue:function(a){function d(a,d){var c={};return a.children("option").each(function(a,
e){var g,f=b(e).attr("value");""!==f&&(g=Math.abs(f-d),("undefined"==typeof c.distance||g<c.distance)&&(c={value:f,distance:g}))}),c.value}if(a){var c="string"==typeof a?moment(a,this.options.format):moment(a),e=this,f={};c.isValid()&&(b.each(this.map,function(a,b){"ampm"!==a&&(f[a]=c[b[1]]())}),this.$ampm&&(12<=f.hour?(f.ampm="pm",12<f.hour&&(f.hour-=12)):(f.ampm="am",0===f.hour&&(f.hour=12))),b.each(f,function(a,b){e["$"+a]&&("minute"===a&&1<e.options.minuteStep&&e.options.roundTime&&(b=d(e["$"+
a],b)),"second"===a&&1<e.options.secondStep&&e.options.roundTime&&(b=d(e["$"+a],b)),e["$"+a].val(b))}),this.options.smartDays&&this.fillCombo("day"),this.$element.val(c.format(this.options.format)).change())}},highlight:function(a){a.isValid()?this.options.errorClass?this.$widget.removeClass(this.options.errorClass):this.$widget.find("select").css("border-color",this.borderColor):this.options.errorClass?this.$widget.addClass(this.options.errorClass):(this.borderColor||(this.borderColor=this.$widget.find("select").css("border-color")),
this.$widget.find("select").css("border-color","red"))},leadZero:function(a){return 9>=a?"0"+a:a},destroy:function(){this.$widget.remove();this.$element.removeData("combodate").show()}};b.fn.combodate=function(a){var d,g=Array.apply(null,arguments);return g.shift(),"getValue"===a&&this.length&&(d=this.eq(0).data("combodate"))?d.getValue.apply(d,g):this.each(function(){var d=b(this),f=d.data("combodate"),h="object"==typeof a&&a;f||d.data("combodate",f=new c(this,h));"string"==typeof a&&"function"==
typeof f[a]&&f[a].apply(f,g)})};b.fn.combodate.defaults={format:"DD-MM-YYYY HH:mm",template:"D / MMM / YYYY   H : mm",value:null,minYear:1970,maxYear:2015,yearDescending:!0,minuteStep:5,secondStep:1,firstItem:"empty",errorClass:null,roundTime:!0,smartDays:!1}})(window.jQuery);
(function(b){var c=function(a){this.init("combodate",a,c.defaults);this.options.viewformat||(this.options.viewformat=this.options.format);a.combodate=b.fn.editableutils.tryParseJson(a.combodate,!0);this.options.combodate=b.extend({},c.defaults.combodate,a.combodate,{format:this.options.format,template:this.options.template})};b.fn.editableutils.inherit(c,b.fn.editabletypes.abstractinput);b.extend(c.prototype,{render:function(){this.$input.combodate(this.options.combodate);"bs3"===b.fn.editableform.engine&&
this.$input.siblings().find("select").addClass("form-control");this.options.inputclass&&this.$input.siblings().find("select").addClass(this.options.inputclass)},value2html:function(a,b){var g=a?a.format(this.options.viewformat):"";c.superclass.value2html.call(this,g,b)},html2value:function(a){return a?moment(a,this.options.viewformat):null},value2str:function(a){return a?a.format(this.options.format):""},str2value:function(a){return a?moment(a,this.options.format):null},value2submit:function(a){return this.value2str(a)},
value2input:function(a){this.$input.combodate("setValue",a)},input2value:function(){return this.$input.combodate("getValue",null)},activate:function(){this.$input.siblings(".combodate").find("select").eq(0).focus()},autosubmit:function(){}});c.defaults=b.extend({},b.fn.editabletypes.abstractinput.defaults,{tpl:'<input type="text">',inputclass:null,format:"YYYY-MM-DD",viewformat:null,template:"D / MMM / YYYY",combodate:null});b.fn.editabletypes.combodate=c})(window.jQuery);
(function(b){var c=b.fn.editableform.Constructor.prototype.initInput;b.extend(b.fn.editableform.Constructor.prototype,{initTemplate:function(){this.$form=b(b.fn.editableform.template);this.$form.find(".control-group").addClass("form-group");this.$form.find(".editable-error-block").addClass("help-block")},initInput:function(){c.apply(this);var a=null===this.input.options.inputclass||!1===this.input.options.inputclass;~b.inArray(this.input.type,"text select textarea password email url tel number range time typeaheadjs".split(" "))&&
(this.input.$input.addClass("form-control"),a&&(this.input.options.inputclass="input-sm",this.input.$input.addClass("input-sm")));for(var d=this.$form.find(".editable-buttons"),a=a?["input-sm"]:this.input.options.inputclass.split(" "),g=0;g<a.length;g++)"input-lg"===a[g].toLowerCase()&&d.find("button").removeClass("btn-sm").addClass("btn-lg")}});b.fn.editableform.buttons='<button type="submit" class="btn btn-primary btn-sm editable-submit"><i class="glyphicon glyphicon-ok"></i></button><button type="button" class="btn btn-default btn-sm editable-cancel"><i class="glyphicon glyphicon-remove"></i></button>';
b.fn.editableform.errorGroupClass="has-error";b.fn.editableform.errorBlockClass=null;b.fn.editableform.engine="bs3"})(window.jQuery);
(function(b){b.extend(b.fn.editableContainer.Popup.prototype,{containerName:"popover",containerDataName:"bs.popover",innerCss:".popover-content",defaults:b.fn.popover.Constructor.DEFAULTS,initContainer:function(){b.extend(this.containerOptions,{trigger:"manual",selector:!1,content:" ",template:this.defaults.template});var c;this.$element.data("template")&&(c=this.$element.data("template"),this.$element.removeData("template"));this.call(this.containerOptions);c&&this.$element.data("template",c)},innerShow:function(){this.call("show")},
innerHide:function(){this.call("hide")},innerDestroy:function(){this.call("destroy")},setContainerOption:function(b,a){this.container().options[b]=a},setPosition:function(){!function(){var b=this.tip(),a="function"==typeof this.options.placement?this.options.placement.call(this,b[0],this.$element[0]):this.options.placement,d=/\s?auto?\s?/i,g=d.test(a);g&&(a=a.replace(d,"")||"top");var d=this.getPosition(),e=b[0].offsetWidth,f=b[0].offsetHeight;if(g){var h=this.$element.parent(),g=a,l=document.documentElement.scrollTop||
document.body.scrollTop,k="body"==this.options.container?window.innerWidth:h.outerWidth(),n="body"==this.options.container?window.innerHeight:h.outerHeight(),h="body"==this.options.container?0:h.offset().left,a="bottom"==a&&d.top+d.height+f-l>n?"top":"top"==a&&0>d.top-l-f?"bottom":"right"==a&&d.right+e>k?"left":"left"==a&&d.left-e<h?"right":a;b.removeClass(g).addClass(a)}b=this.getCalculatedOffset(a,d,e,f);this.applyPlacement(b,a)}.call(this.container())}})})(window.jQuery);
(function(b){function c(){return new Date(Date.UTC.apply(Date,arguments))}function a(a,d){var c,e=b(a).data(),g={},f=new RegExp("^"+d.toLowerCase()+"([A-Z])");d=new RegExp("^"+d.toLowerCase());for(var h in e)d.test(h)&&(c=h.replace(f,function(a,b){return b.toLowerCase()}),g[c]=e[h]);return g}function d(a){var d={};if(n[a]||(a=a.split("-")[0],n[a])){var c=n[a];return b.each(k,function(a,b){b in c&&(d[b]=c[b])}),d}}var g=function(a,d){this._process_options(d);this.element=b(a);this.isInline=!1;this.isInput=
this.element.is("input");this.hasInput=(this.component=this.element.is(".date")?this.element.find(".add-on, .btn"):!1)&&this.element.find("input").length;this.component&&0===this.component.length&&(this.component=!1);this.picker=b(x.template);this._buildEvents();this._attachEvents();this.isInline?this.picker.addClass("datepicker-inline").appendTo(this.element):this.picker.addClass("datepicker-dropdown dropdown-menu");this.o.rtl&&(this.picker.addClass("datepicker-rtl"),this.picker.find(".prev i, .next i").toggleClass("icon-arrow-left icon-arrow-right"));
this.viewMode=this.o.startView;this.o.calendarWeeks&&this.picker.find("tfoot th.today").attr("colspan",function(a,b){return parseInt(b)+1});this._allow_update=!1;this.setStartDate(this.o.startDate);this.setEndDate(this.o.endDate);this.setDaysOfWeekDisabled(this.o.daysOfWeekDisabled);this.fillDow();this.fillMonths();this._allow_update=!0;this.update();this.showMode();this.isInline&&this.show()};g.prototype={constructor:g,_process_options:function(a){this._o=b.extend({},this._o,a);a=this.o=b.extend({},
this._o);var d=a.language;switch(n[d]||(d=d.split("-")[0],n[d]||(d=l.language)),a.language=d,a.startView){case 2:case "decade":a.startView=2;break;case 1:case "year":a.startView=1;break;default:a.startView=0}switch(a.minViewMode){case 1:case "months":a.minViewMode=1;break;case 2:case "years":a.minViewMode=2;break;default:a.minViewMode=0}a.startView=Math.max(a.startView,a.minViewMode);a.weekStart%=7;a.weekEnd=(a.weekStart+6)%7;d=x.parseFormat(a.format);a.startDate!==-1/0&&(a.startDate=x.parseDate(a.startDate,
d,a.language));1/0!==a.endDate&&(a.endDate=x.parseDate(a.endDate,d,a.language));a.daysOfWeekDisabled=a.daysOfWeekDisabled||[];b.isArray(a.daysOfWeekDisabled)||(a.daysOfWeekDisabled=a.daysOfWeekDisabled.split(/[,\s]*/));a.daysOfWeekDisabled=b.map(a.daysOfWeekDisabled,function(a){return parseInt(a,10)})},_events:[],_secondaryEvents:[],_applyEvents:function(a){for(var b,d,c=0;c<a.length;c++)b=a[c][0],d=a[c][1],b.on(d)},_unapplyEvents:function(a){for(var b,d,c=0;c<a.length;c++)b=a[c][0],d=a[c][1],b.off(d)},
_buildEvents:function(){this.isInput?this._events=[[this.element,{focus:b.proxy(this.show,this),keyup:b.proxy(this.update,this),keydown:b.proxy(this.keydown,this)}]]:this.component&&this.hasInput?this._events=[[this.element.find("input"),{focus:b.proxy(this.show,this),keyup:b.proxy(this.update,this),keydown:b.proxy(this.keydown,this)}],[this.component,{click:b.proxy(this.show,this)}]]:this.element.is("div")?this.isInline=!0:this._events=[[this.element,{click:b.proxy(this.show,this)}]];this._secondaryEvents=
[[this.picker,{click:b.proxy(this.click,this)}],[b(window),{resize:b.proxy(this.place,this)}],[b(document),{mousedown:b.proxy(function(a){this.element.is(a.target)||this.element.find(a.target).size()||this.picker.is(a.target)||this.picker.find(a.target).size()||this.hide()},this)}]]},_attachEvents:function(){this._detachEvents();this._applyEvents(this._events)},_detachEvents:function(){this._unapplyEvents(this._events)},_attachSecondaryEvents:function(){this._detachSecondaryEvents();this._applyEvents(this._secondaryEvents)},
_detachSecondaryEvents:function(){this._unapplyEvents(this._secondaryEvents)},_trigger:function(a,d){var c=d||this.date,e=new Date(c.getTime()+6E4*c.getTimezoneOffset());this.element.trigger({type:a,date:e,format:b.proxy(function(a){return x.formatDate(c,a||this.o.format,this.o.language)},this)})},show:function(a){this.isInline||this.picker.appendTo("body");this.picker.show();this.height=this.component?this.component.outerHeight():this.element.outerHeight();this.place();this._attachSecondaryEvents();
a&&a.preventDefault();this._trigger("show")},hide:function(){this.isInline||this.picker.is(":visible")&&(this.picker.hide().detach(),this._detachSecondaryEvents(),this.viewMode=this.o.startView,this.showMode(),this.o.forceParse&&(this.isInput&&this.element.val()||this.hasInput&&this.element.find("input").val())&&this.setValue(),this._trigger("hide"))},remove:function(){this.hide();this._detachEvents();this._detachSecondaryEvents();this.picker.remove();delete this.element.data().datepicker;this.isInput||
delete this.element.data().date},getDate:function(){var a=this.getUTCDate();return new Date(a.getTime()+6E4*a.getTimezoneOffset())},getUTCDate:function(){return this.date},setDate:function(a){this.setUTCDate(new Date(a.getTime()-6E4*a.getTimezoneOffset()))},setUTCDate:function(a){this.date=a;this.setValue()},setValue:function(){var a=this.getFormattedDate();this.isInput?this.element.val(a):this.component&&this.element.find("input").val(a)},getFormattedDate:function(a){return void 0===a&&(a=this.o.format),
x.formatDate(this.date,a,this.o.language)},setStartDate:function(a){this._process_options({startDate:a});this.update();this.updateNavArrows()},setEndDate:function(a){this._process_options({endDate:a});this.update();this.updateNavArrows()},setDaysOfWeekDisabled:function(a){this._process_options({daysOfWeekDisabled:a});this.update();this.updateNavArrows()},place:function(){if(!this.isInline){var a=parseInt(this.element.parents().filter(function(){return"auto"!=b(this).css("z-index")}).first().css("z-index"))+
10,d=this.component?this.component.parent().offset():this.element.offset(),c=this.component?this.component.outerHeight(!0):this.element.outerHeight(!0);this.picker.css({top:d.top+c,left:d.left,zIndex:a})}},_allow_update:!0,update:function(){if(this._allow_update){var a,b=!1;arguments&&arguments.length&&("string"==typeof arguments[0]||arguments[0]instanceof Date)?(a=arguments[0],b=!0):(a=this.isInput?this.element.val():this.element.data("date")||this.element.find("input").val(),delete this.element.data().date);
this.date=x.parseDate(a,this.o.format,this.o.language);b&&this.setValue();this.viewDate=this.date<this.o.startDate?new Date(this.o.startDate):this.date>this.o.endDate?new Date(this.o.endDate):new Date(this.date);this.fill()}},fillDow:function(){var a=this.o.weekStart,b="<tr>";this.o.calendarWeeks&&(b+='<th class="cw">&nbsp;</th>',this.picker.find(".datepicker-days thead tr:first-child").prepend('<th class="cw">&nbsp;</th>'));for(;a<this.o.weekStart+7;)b+='<th class="dow">'+n[this.o.language].daysMin[a++%
7]+"</th>";b+="</tr>";this.picker.find(".datepicker-days thead").append(b)},fillMonths:function(){for(var a="",b=0;12>b;)a+='<span class="month">'+n[this.o.language].monthsShort[b++]+"</span>";this.picker.find(".datepicker-months td").html(a)},setRange:function(a){a&&a.length?this.range=b.map(a,function(a){return a.valueOf()}):delete this.range;this.fill()},getClassNames:function(a){var d=[],c=this.viewDate.getUTCFullYear(),e=this.viewDate.getUTCMonth(),g=this.date.valueOf(),f=new Date;return a.getUTCFullYear()<
c||a.getUTCFullYear()==c&&a.getUTCMonth()<e?d.push("old"):(a.getUTCFullYear()>c||a.getUTCFullYear()==c&&a.getUTCMonth()>e)&&d.push("new"),this.o.todayHighlight&&a.getUTCFullYear()==f.getFullYear()&&a.getUTCMonth()==f.getMonth()&&a.getUTCDate()==f.getDate()&&d.push("today"),g&&a.valueOf()==g&&d.push("active"),(a.valueOf()<this.o.startDate||a.valueOf()>this.o.endDate||-1!==b.inArray(a.getUTCDay(),this.o.daysOfWeekDisabled))&&d.push("disabled"),this.range&&(a>this.range[0]&&a<this.range[this.range.length-
1]&&d.push("range"),-1!=b.inArray(a.valueOf(),this.range)&&d.push("selected")),d},fill:function(){var a,d=new Date(this.viewDate),e=d.getUTCFullYear(),g=d.getUTCMonth(),d=this.o.startDate!==-1/0?this.o.startDate.getUTCFullYear():-1/0,f=this.o.startDate!==-1/0?this.o.startDate.getUTCMonth():-1/0,h=1/0!==this.o.endDate?this.o.endDate.getUTCFullYear():1/0,k=1/0!==this.o.endDate?this.o.endDate.getUTCMonth():1/0;this.date&&this.date.valueOf();this.picker.find(".datepicker-days thead th.datepicker-switch").text(n[this.o.language].months[g]+
" "+e);this.picker.find("tfoot th.today").text(n[this.o.language].today).toggle(!1!==this.o.todayBtn);this.picker.find("tfoot th.clear").text(n[this.o.language].clear).toggle(!1!==this.o.clearBtn);this.updateNavArrows();this.fillMonths();var l=c(e,g-1,28,0,0,0,0),g=x.getDaysInMonth(l.getUTCFullYear(),l.getUTCMonth());l.setUTCDate(g);l.setUTCDate(g-(l.getUTCDay()-this.o.weekStart+7)%7);var A=new Date(l);A.setUTCDate(A.getUTCDate()+42);for(var A=A.valueOf(),y,g=[];l.valueOf()<A;){if(l.getUTCDay()==
this.o.weekStart&&(g.push("<tr>"),this.o.calendarWeeks)){y=new Date(+l+864E5*((this.o.weekStart-l.getUTCDay()-7)%7));y=new Date(+y+864E5*((11-y.getUTCDay())%7));var G=new Date(+(G=c(y.getUTCFullYear(),0,1))+864E5*((11-G.getUTCDay())%7));g.push('<td class="cw">'+((y-G)/864E5/7+1)+"</td>")}y=this.getClassNames(l);y.push("day");var K=this.o.beforeShowDay(l);void 0===K?K={}:"boolean"==typeof K?K={enabled:K}:"string"==typeof K&&(K={classes:K});!1===K.enabled&&y.push("disabled");K.classes&&(y=y.concat(K.classes.split(/\s+/)));
K.tooltip&&(a=K.tooltip);y=b.unique(y);g.push('<td class="'+y.join(" ")+'"'+(a?' title="'+a+'"':"")+">"+l.getUTCDate()+"</td>");l.getUTCDay()==this.o.weekEnd&&g.push("</tr>");l.setUTCDate(l.getUTCDate()+1)}this.picker.find(".datepicker-days tbody").empty().append(g.join(""));a=this.date&&this.date.getUTCFullYear();g=this.picker.find(".datepicker-months").find("th:eq(1)").text(e).end().find("span").removeClass("active");a&&a==e&&g.eq(this.date.getUTCMonth()).addClass("active");(d>e||e>h)&&g.addClass("disabled");
e==d&&g.slice(0,f).addClass("disabled");e==h&&g.slice(k+1).addClass("disabled");g="";e=10*parseInt(e/10,10);f=this.picker.find(".datepicker-years").find("th:eq(1)").text(e+"-"+(e+9)).end().find("td");--e;for(k=-1;11>k;k++)g+='<span class="year'+(-1==k?" old":10==k?" new":"")+(a==e?" active":"")+(d>e||e>h?" disabled":"")+'">'+e+"</span>",e+=1;f.html(g)},updateNavArrows:function(){if(this._allow_update){var a=new Date(this.viewDate),b=a.getUTCFullYear(),a=a.getUTCMonth();switch(this.viewMode){case 0:this.o.startDate!==
-1/0&&b<=this.o.startDate.getUTCFullYear()&&a<=this.o.startDate.getUTCMonth()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"});1/0!==this.o.endDate&&b>=this.o.endDate.getUTCFullYear()&&a>=this.o.endDate.getUTCMonth()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"});break;case 1:case 2:this.o.startDate!==-1/0&&b<=this.o.startDate.getUTCFullYear()?this.picker.find(".prev").css({visibility:"hidden"}):
this.picker.find(".prev").css({visibility:"visible"}),1/0!==this.o.endDate&&b>=this.o.endDate.getUTCFullYear()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"})}}},click:function(a){a.preventDefault();a=b(a.target).closest("span, td, th");if(1==a.length)switch(a[0].nodeName.toLowerCase()){case "th":switch(a[0].className){case "datepicker-switch":this.showMode(1);break;case "prev":case "next":a=x.modes[this.viewMode].navStep*("prev"==a[0].className?
-1:1);switch(this.viewMode){case 0:this.viewDate=this.moveMonth(this.viewDate,a);break;case 1:case 2:this.viewDate=this.moveYear(this.viewDate,a)}this.fill();break;case "today":a=new Date;a=c(a.getFullYear(),a.getMonth(),a.getDate(),0,0,0);this.showMode(-2);this._setDate(a,"linked"==this.o.todayBtn?null:"view");break;case "clear":var d;this.isInput?d=this.element:this.component&&(d=this.element.find("input"));d&&d.val("").change();this._trigger("changeDate");this.update();this.o.autoclose&&this.hide()}break;
case "span":if(!a.is(".disabled")){if(this.viewDate.setUTCDate(1),a.is(".month")){d=1;var e=a.parent().find("span").index(a),g=this.viewDate.getUTCFullYear();this.viewDate.setUTCMonth(e);this._trigger("changeMonth",this.viewDate);1===this.o.minViewMode&&this._setDate(c(g,e,d,0,0,0,0))}else g=parseInt(a.text(),10)||0,d=1,e=0,this.viewDate.setUTCFullYear(g),this._trigger("changeYear",this.viewDate),2===this.o.minViewMode&&this._setDate(c(g,e,d,0,0,0,0));this.showMode(-1);this.fill()}break;case "td":a.is(".day")&&
!a.is(".disabled")&&(d=parseInt(a.text(),10)||1,g=this.viewDate.getUTCFullYear(),e=this.viewDate.getUTCMonth(),a.is(".old")?0===e?(e=11,--g):--e:a.is(".new")&&(11==e?(e=0,g+=1):e+=1),this._setDate(c(g,e,d,0,0,0,0)))}},_setDate:function(a,b){b&&"date"!=b||(this.date=new Date(a));b&&"view"!=b||(this.viewDate=new Date(a));this.fill();this.setValue();this._trigger("changeDate");var d;this.isInput?d=this.element:this.component&&(d=this.element.find("input"));d&&(d.change(),!this.o.autoclose||b&&"date"!=
b||this.hide())},moveMonth:function(a,b){if(!b)return a;var d,c,e=new Date(a.valueOf()),g=e.getUTCDate(),f=e.getUTCMonth();c=Math.abs(b);if(b=0<b?1:-1,1==c)c=-1==b?function(){return e.getUTCMonth()==f}:function(){return e.getUTCMonth()!=d},d=f+b,e.setUTCMonth(d),(0>d||11<d)&&(d=(d+12)%12);else{for(var h=0;c>h;h++)e=this.moveMonth(e,b);d=e.getUTCMonth();e.setUTCDate(g);c=function(){return d!=e.getUTCMonth()}}for(;c();)e.setUTCDate(--g),e.setUTCMonth(d);return e},moveYear:function(a,b){return this.moveMonth(a,
12*b)},dateWithinRange:function(a){return a>=this.o.startDate&&a<=this.o.endDate},keydown:function(a){if(this.picker.is(":not(:visible)"))return 27==a.keyCode&&this.show(),void 0;var b,d,c,e=!1;switch(a.keyCode){case 27:this.hide();a.preventDefault();break;case 37:case 39:if(!this.o.keyboardNavigation)break;b=37==a.keyCode?-1:1;a.ctrlKey?(d=this.moveYear(this.date,b),c=this.moveYear(this.viewDate,b)):a.shiftKey?(d=this.moveMonth(this.date,b),c=this.moveMonth(this.viewDate,b)):(d=new Date(this.date),
d.setUTCDate(this.date.getUTCDate()+b),c=new Date(this.viewDate),c.setUTCDate(this.viewDate.getUTCDate()+b));this.dateWithinRange(d)&&(this.date=d,this.viewDate=c,this.setValue(),this.update(),a.preventDefault(),e=!0);break;case 38:case 40:if(!this.o.keyboardNavigation)break;b=38==a.keyCode?-1:1;a.ctrlKey?(d=this.moveYear(this.date,b),c=this.moveYear(this.viewDate,b)):a.shiftKey?(d=this.moveMonth(this.date,b),c=this.moveMonth(this.viewDate,b)):(d=new Date(this.date),d.setUTCDate(this.date.getUTCDate()+
7*b),c=new Date(this.viewDate),c.setUTCDate(this.viewDate.getUTCDate()+7*b));this.dateWithinRange(d)&&(this.date=d,this.viewDate=c,this.setValue(),this.update(),a.preventDefault(),e=!0);break;case 13:this.hide();a.preventDefault();break;case 9:this.hide()}if(e){this._trigger("changeDate");var g;this.isInput?g=this.element:this.component&&(g=this.element.find("input"));g&&g.change()}},showMode:function(a){a&&(this.viewMode=Math.max(this.o.minViewMode,Math.min(2,this.viewMode+a)));this.picker.find(">div").hide().filter(".datepicker-"+
x.modes[this.viewMode].clsName).css("display","block");this.updateNavArrows()}};var e=function(a,d){this.element=b(a);this.inputs=b.map(d.inputs,function(a){return a.jquery?a[0]:a});delete d.inputs;b(this.inputs).datepicker(d).bind("changeDate",b.proxy(this.dateUpdated,this));this.pickers=b.map(this.inputs,function(a){return b(a).data("datepicker")});this.updateDates()};e.prototype={updateDates:function(){this.dates=b.map(this.pickers,function(a){return a.date});this.updateRanges()},updateRanges:function(){var a=
b.map(this.dates,function(a){return a.valueOf()});b.each(this.pickers,function(b,d){d.setRange(a)})},dateUpdated:function(a){var d=b(a.target).data("datepicker").getUTCDate();a=b.inArray(a.target,this.inputs);var c=this.inputs.length;if(-1!=a){if(d<this.dates[a])for(;0<=a&&d<this.dates[a];)this.pickers[a--].setUTCDate(d);else if(d>this.dates[a])for(;c>a&&d>this.dates[a];)this.pickers[a++].setUTCDate(d);this.updateDates()}},remove:function(){b.map(this.pickers,function(a){a.remove()});delete this.element.data().datepicker}};
var f=b.fn.datepicker,h=b.fn.datepicker=function(c){var f=Array.apply(null,arguments);f.shift();var h;return this.each(function(){var k=b(this),n=k.data("datepicker"),x="object"==typeof c&&c;if(!n){var n=a(this,"date"),L=b.extend({},l,n,x),L=d(L.language),x=b.extend({},l,L,n,x);k.is(".input-daterange")||x.inputs?(n={inputs:x.inputs||k.find("input").toArray()},k.data("datepicker",n=new e(this,b.extend(x,n)))):k.data("datepicker",n=new g(this,x))}return"string"==typeof c&&"function"==typeof n[c]&&(h=
n[c].apply(n,f),void 0!==h)?!1:void 0}),void 0!==h?h:this},l=b.fn.datepicker.defaults={autoclose:!1,beforeShowDay:b.noop,calendarWeeks:!1,clearBtn:!1,daysOfWeekDisabled:[],endDate:1/0,forceParse:!0,format:"mm/dd/yyyy",keyboardNavigation:!0,language:"en",minViewMode:0,rtl:!1,startDate:-1/0,startView:0,todayBtn:!1,todayHighlight:!1,weekStart:0},k=b.fn.datepicker.locale_opts=["format","rtl","weekStart"];b.fn.datepicker.Constructor=g;var n=b.fn.datepicker.dates={en:{days:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),
daysShort:"Sun Mon Tue Wed Thu Fri Sat Sun".split(" "),daysMin:"Su Mo Tu We Th Fr Sa Su".split(" "),months:"January February March April May June July August September October November December".split(" "),monthsShort:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),today:"Today",clear:"Clear"}},x={modes:[{clsName:"days",navFnc:"Month",navStep:1},{clsName:"months",navFnc:"FullYear",navStep:1},{clsName:"years",navFnc:"FullYear",navStep:10}],isLeapYear:function(a){return 0===a%4&&0!==a%
100||0===a%400},getDaysInMonth:function(a,b){return[31,x.isLeapYear(a)?29:28,31,30,31,30,31,31,30,31,30,31][b]},validParts:/dd?|DD?|mm?|MM?|yy(?:yy)?/g,nonpunctuation:/[^ -\/:-@\[\u3400-\u9fff-`{-~\t\n\r]+/g,parseFormat:function(a){var b=a.replace(this.validParts,"\x00").split("\x00");a=a.match(this.validParts);if(!b||!b.length||!a||0===a.length)throw Error("Invalid date format.");return{separators:b,parts:a}},parseDate:function(a,d,e){if(a instanceof Date)return a;if("string"==typeof d&&(d=x.parseFormat(d)),
/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/.test(a)){var f,h,k=/([\-+]\d+)([dmwy])/,l=a.match(/([\-+]\d+)([dmwy])/g);a=new Date;for(var z=0;z<l.length;z++)switch(f=k.exec(l[z]),h=parseInt(f[1]),f[2]){case "d":a.setUTCDate(a.getUTCDate()+h);break;case "m":a=g.prototype.moveMonth.call(g.prototype,a,h);break;case "w":a.setUTCDate(a.getUTCDate()+7*h);break;case "y":a=g.prototype.moveYear.call(g.prototype,a,h)}return c(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate(),0,0,0)}var A,l=a&&a.match(this.nonpunctuation)||
[];a=new Date;h={};var y="yyyy yy M MM m mm d dd".split(" "),k={yyyy:function(a,b){return a.setUTCFullYear(b)},yy:function(a,b){return a.setUTCFullYear(2E3+b)},m:function(a,b){for(--b;0>b;)b+=12;b%=12;for(a.setUTCMonth(b);a.getUTCMonth()!=b;)a.setUTCDate(a.getUTCDate()-1);return a},d:function(a,b){return a.setUTCDate(b)}};k.M=k.MM=k.mm=k.m;k.dd=k.d;a=c(a.getFullYear(),a.getMonth(),a.getDate(),0,0,0);d=d.parts.slice();if(l.length!=d.length&&(d=b(d).filter(function(a,d){return-1!==b.inArray(d,y)}).toArray()),
l.length==d.length){for(var z=0,G=d.length;G>z;z++){if(A=parseInt(l[z],10),f=d[z],isNaN(A))switch(f){case "MM":A=b(n[e].months).filter(function(){var a=this.slice(0,l[z].length),b=l[z].slice(0,a.length);return a==b});A=b.inArray(A[0],n[e].months)+1;break;case "M":A=b(n[e].monthsShort).filter(function(){var a=this.slice(0,l[z].length),b=l[z].slice(0,a.length);return a==b}),A=b.inArray(A[0],n[e].monthsShort)+1}h[f]=A}for(z=0;z<y.length;z++)f=y[z],f in h&&!isNaN(h[f])&&k[f](a,h[f])}return a},formatDate:function(a,
d,c){"string"==typeof d&&(d=x.parseFormat(d));c={d:a.getUTCDate(),D:n[c].daysShort[a.getUTCDay()],DD:n[c].days[a.getUTCDay()],m:a.getUTCMonth()+1,M:n[c].monthsShort[a.getUTCMonth()],MM:n[c].months[a.getUTCMonth()],yy:a.getUTCFullYear().toString().substring(2),yyyy:a.getUTCFullYear()};c.dd=(10>c.d?"0":"")+c.d;c.mm=(10>c.m?"0":"")+c.m;a=[];for(var e=b.extend([],d.separators),g=0,f=d.parts.length;f>=g;g++)e.length&&a.push(e.shift()),a.push(c[d.parts[g]]);return a.join("")},headTemplate:'<thead><tr><th class="prev"><i class="icon-arrow-left"/></th><th colspan="5" class="datepicker-switch"></th><th class="next"><i class="icon-arrow-right"/></th></tr></thead>',
contTemplate:'<tbody><tr><td colspan="7"></td></tr></tbody>',footTemplate:'<tfoot><tr><th colspan="7" class="today"></th></tr><tr><th colspan="7" class="clear"></th></tr></tfoot>'};x.template='<div class="datepicker"><div class="datepicker-days"><table class=" table-condensed">'+x.headTemplate+"<tbody></tbody>"+x.footTemplate+'</table></div><div class="datepicker-months"><table class="table-condensed">'+x.headTemplate+x.contTemplate+x.footTemplate+'</table></div><div class="datepicker-years"><table class="table-condensed">'+
x.headTemplate+x.contTemplate+x.footTemplate+"</table></div></div>";b.fn.datepicker.DPGlobal=x;b.fn.datepicker.noConflict=function(){return b.fn.datepicker=f,this};b(document).on("focus.datepicker.data-api click.datepicker.data-api",'[data-provide="datepicker"]',function(a){var d=b(this);d.data("datepicker")||(a.preventDefault(),h.call(d,"show"))});b(function(){h.call(b('[data-provide="datepicker-inline"]'))})})(window.jQuery);
(function(b){b.fn.bdatepicker=b.fn.datepicker.noConflict();b.fn.datepicker||(b.fn.datepicker=b.fn.bdatepicker);var c=function(a){this.init("date",a,c.defaults);this.initPicker(a,c.defaults)};b.fn.editableutils.inherit(c,b.fn.editabletypes.abstractinput);b.extend(c.prototype,{initPicker:function(a,d){this.options.viewformat||(this.options.viewformat=this.options.format);a.datepicker=b.fn.editableutils.tryParseJson(a.datepicker,!0);this.options.datepicker=b.extend({},d.datepicker,a.datepicker,{format:this.options.viewformat});
this.options.datepicker.language=this.options.datepicker.language||"en";this.dpg=b.fn.bdatepicker.DPGlobal;this.parsedFormat=this.dpg.parseFormat(this.options.format);this.parsedViewFormat=this.dpg.parseFormat(this.options.viewformat)},render:function(){this.$input.bdatepicker(this.options.datepicker);this.options.clear&&(this.$clear=b('<a href="#"></a>').html(this.options.clear).click(b.proxy(function(a){a.preventDefault();a.stopPropagation();this.clear()},this)),this.$tpl.parent().append(b('<div class="editable-clear">').append(this.$clear)))},
value2html:function(a,b){var g=a?this.dpg.formatDate(a,this.parsedViewFormat,this.options.datepicker.language):"";c.superclass.value2html.call(this,g,b)},html2value:function(a){return this.parseDate(a,this.parsedViewFormat)},value2str:function(a){return a?this.dpg.formatDate(a,this.parsedFormat,this.options.datepicker.language):""},str2value:function(a){return this.parseDate(a,this.parsedFormat)},value2submit:function(a){return this.value2str(a)},value2input:function(a){this.$input.bdatepicker("update",
a)},input2value:function(){return this.$input.data("datepicker").date},activate:function(){},clear:function(){this.$input.data("datepicker").date=null;this.$input.find(".active").removeClass("active");this.options.showbuttons||this.$input.closest("form").submit()},autosubmit:function(){this.$input.on("mouseup",".day",function(a){if(!b(a.currentTarget).is(".old")&&!b(a.currentTarget).is(".new")){var d=b(this).closest("form");setTimeout(function(){d.submit()},200)}})},parseDate:function(a,b){var c,
e=null;return a&&(e=this.dpg.parseDate(a,b,this.options.datepicker.language),"string"==typeof a&&(c=this.dpg.formatDate(e,b,this.options.datepicker.language),a!==c&&(e=null))),e}});c.defaults=b.extend({},b.fn.editabletypes.abstractinput.defaults,{tpl:'<div class="editable-date well"></div>',inputclass:null,format:"yyyy-mm-dd",viewformat:null,datepicker:{weekStart:0,startView:0,minViewMode:0,autoclose:!1},clear:"&times; clear"});b.fn.editabletypes.date=c})(window.jQuery);
(function(b){var c=function(a){this.init("datefield",a,c.defaults);this.initPicker(a,c.defaults)};b.fn.editableutils.inherit(c,b.fn.editabletypes.date);b.extend(c.prototype,{render:function(){this.$input=this.$tpl.find("input");this.setClass();this.setAttr("placeholder");this.$tpl.bdatepicker(this.options.datepicker);this.$input.off("focus keydown");this.$input.keyup(b.proxy(function(){this.$tpl.removeData("date");this.$tpl.bdatepicker("update")},this))},value2input:function(a){this.$input.val(a?
this.dpg.formatDate(a,this.parsedViewFormat,this.options.datepicker.language):"");this.$tpl.bdatepicker("update")},input2value:function(){return this.html2value(this.$input.val())},activate:function(){b.fn.editabletypes.text.prototype.activate.call(this)},autosubmit:function(){}});c.defaults=b.extend({},b.fn.editabletypes.date.defaults,{tpl:'<div class="input-append date"><input type="text"/><span class="add-on"><i class="icon-th"></i></span></div>',inputclass:"input-small",datepicker:{weekStart:0,
startView:0,minViewMode:0,autoclose:!0}});b.fn.editabletypes.datefield=c})(window.jQuery);
(function(b){var c=function(a){this.init("datetime",a,c.defaults);this.initPicker(a,c.defaults)};b.fn.editableutils.inherit(c,b.fn.editabletypes.abstractinput);b.extend(c.prototype,{initPicker:function(a,d){this.options.viewformat||(this.options.viewformat=this.options.format);a.datetimepicker=b.fn.editableutils.tryParseJson(a.datetimepicker,!0);this.options.datetimepicker=b.extend({},d.datetimepicker,a.datetimepicker,{format:this.options.viewformat});this.options.datetimepicker.language=this.options.datetimepicker.language||
"en";this.dpg=b.fn.datetimepicker.DPGlobal;this.parsedFormat=this.dpg.parseFormat(this.options.format,this.options.formatType);this.parsedViewFormat=this.dpg.parseFormat(this.options.viewformat,this.options.formatType)},render:function(){this.$input.datetimepicker(this.options.datetimepicker);this.$input.on("changeMode",function(){var a=b(this).closest("form").parent();setTimeout(function(){a.triggerHandler("resize")},0)});this.options.clear&&(this.$clear=b('<a href="#"></a>').html(this.options.clear).click(b.proxy(function(a){a.preventDefault();
a.stopPropagation();this.clear()},this)),this.$tpl.parent().append(b('<div class="editable-clear">').append(this.$clear)))},value2html:function(a,b){var g=a?this.dpg.formatDate(this.toUTC(a),this.parsedViewFormat,this.options.datetimepicker.language,this.options.formatType):"";return b?(c.superclass.value2html.call(this,g,b),void 0):g},html2value:function(a){return(a=this.parseDate(a,this.parsedViewFormat))?this.fromUTC(a):null},value2str:function(a){return a?this.dpg.formatDate(this.toUTC(a),this.parsedFormat,
this.options.datetimepicker.language,this.options.formatType):""},str2value:function(a){return(a=this.parseDate(a,this.parsedFormat))?this.fromUTC(a):null},value2submit:function(a){return this.value2str(a)},value2input:function(a){a&&this.$input.data("datetimepicker").setDate(a)},input2value:function(){var a=this.$input.data("datetimepicker");return a.date?a.getDate():null},activate:function(){},clear:function(){this.$input.data("datetimepicker").date=null;this.$input.find(".active").removeClass("active");
this.options.showbuttons||this.$input.closest("form").submit()},autosubmit:function(){this.$input.on("mouseup",".minute",function(){var a=b(this).closest("form");setTimeout(function(){a.submit()},200)})},toUTC:function(a){return a?new Date(a.valueOf()-6E4*a.getTimezoneOffset()):a},fromUTC:function(a){return a?new Date(a.valueOf()+6E4*a.getTimezoneOffset()):a},parseDate:function(a,b){var c,e=null;return a&&(e=this.dpg.parseDate(a,b,this.options.datetimepicker.language,this.options.formatType),"string"==
typeof a&&(c=this.dpg.formatDate(e,b,this.options.datetimepicker.language,this.options.formatType),a!==c&&(e=null))),e}});c.defaults=b.extend({},b.fn.editabletypes.abstractinput.defaults,{tpl:'<div class="editable-date well"></div>',inputclass:null,format:"yyyy-mm-dd hh:ii",formatType:"standard",viewformat:null,datetimepicker:{todayHighlight:!1,autoclose:!1},clear:"&times; clear"});b.fn.editabletypes.datetime=c})(window.jQuery);
(function(b){var c=function(a){this.init("datetimefield",a,c.defaults);this.initPicker(a,c.defaults)};b.fn.editableutils.inherit(c,b.fn.editabletypes.datetime);b.extend(c.prototype,{render:function(){this.$input=this.$tpl.find("input");this.setClass();this.setAttr("placeholder");this.$tpl.datetimepicker(this.options.datetimepicker);this.$input.off("focus keydown");this.$input.keyup(b.proxy(function(){this.$tpl.removeData("date");this.$tpl.datetimepicker("update")},this))},value2input:function(a){this.$input.val(this.value2html(a));
this.$tpl.datetimepicker("update")},input2value:function(){return this.html2value(this.$input.val())},activate:function(){b.fn.editabletypes.text.prototype.activate.call(this)},autosubmit:function(){}});c.defaults=b.extend({},b.fn.editabletypes.datetime.defaults,{tpl:'<div class="input-append date"><input type="text"/><span class="add-on"><i class="icon-th"></i></span></div>',inputclass:"input-medium",datetimepicker:{todayHighlight:!1,autoclose:!0}});b.fn.editabletypes.datetimefield=c})(window.jQuery);
(function(b){var c,a=function(){var a=document.createElement("input");return a.setAttribute("onpaste",""),"function"==typeof a.onpaste?"paste":"input"}()+".mask",d=navigator.userAgent,g=/iphone/i.test(d),e=/android/i.test(d);b.mask={definitions:{9:"[0-9]",a:"[A-Za-z]","*":"[A-Za-z0-9]"},dataName:"rawMaskFn",placeholder:"_"};b.fn.extend({caret:function(a,b){var d;if(0!==this.length&&!this.is(":hidden"))return"number"==typeof a?(b="number"==typeof b?b:a,this.each(function(){this.setSelectionRange?this.setSelectionRange(a,
b):this.createTextRange&&(d=this.createTextRange(),d.collapse(!0),d.moveEnd("character",b),d.moveStart("character",a),d.select())})):(this[0].setSelectionRange?(a=this[0].selectionStart,b=this[0].selectionEnd):document.selection&&document.selection.createRange&&(d=document.selection.createRange(),a=0-d.duplicate().moveStart("character",-1E5),b=a+d.text.length),{begin:a,end:b})},unmask:function(){return this.trigger("unmask")},mask:function(d,h){var l,k,n,x,m,p;return!d&&0<this.length?(l=b(this[0]),
l.data(b.mask.dataName)()):(h=b.extend({placeholder:b.mask.placeholder,completed:null},h),k=b.mask.definitions,n=[],x=p=d.length,m=null,b.each(d.split(""),function(a,b){"?"==b?(p--,x=a):k[b]?(n.push(RegExp(k[b])),null===m&&(m=n.length-1)):n.push(null)}),this.trigger("unmask").each(function(){function l(a){for(;p>++a&&!n[a];);return a}function D(a,b){var d,c;if(!(0>a)){d=a;for(c=l(b);p>d;d++)if(n[d]){if(!(p>c&&n[d].test(G[c])))break;G[d]=G[c];G[c]=h.placeholder;c=l(c)}z();y.caret(Math.max(m,a))}}function H(a){var b,
d,c=a.which;if(8===c||46===c||g&&127===c){b=y.caret();d=b.begin;b=b.end;if(0===b-d){if(46!==c)for(;0<=--d&&!n[d];);else d=b=l(d-1);b=46===c?l(b):b}L(d,b);D(d,b-1);a.preventDefault()}else 27==c&&(y.val(K),y.caret(0,A()),a.preventDefault())}function J(a){var d,c,g;c=a.which;d=y.caret();if(!(a.ctrlKey||a.altKey||a.metaKey||32>c)&&c){0!==d.end-d.begin&&(L(d.begin,d.end),D(d.begin,d.end-1));d=l(d.begin-1);if(p>d&&(c=String.fromCharCode(c),n[d].test(c))){var f,k,m;f=d;for(k=h.placeholder;p>f;f++)if(n[f]){if(g=
l(f),m=G[f],G[f]=k,!(p>g&&n[g].test(m)))break;k=m}G[d]=c;z();g=l(d);e?setTimeout(b.proxy(b.fn.caret,y,g),0):y.caret(g);h.completed&&g>=p&&h.completed.call(y)}a.preventDefault()}}function L(a,b){var d;for(d=a;b>d&&p>d;d++)n[d]&&(G[d]=h.placeholder)}function z(){y.val(G.join(""))}function A(a){var b,d,c=y.val(),e=-1;for(pos=b=0;p>b;b++)if(n[b]){for(G[b]=h.placeholder;pos++<c.length;)if(d=c.charAt(pos-1),n[b].test(d)){G[b]=d;e=b;break}if(pos>c.length)break}else G[b]===c.charAt(pos)&&b!==x&&(pos++,e=
b);return a?z():x>e+1?(y.val(""),L(0,p)):(z(),y.val(y.val().substring(0,e+1))),x?b:m}var y=b(this),G=b.map(d.split(""),function(a){return"?"!=a?k[a]?h.placeholder:a:void 0}),K=y.val();y.data(b.mask.dataName,function(){return b.map(G,function(a,b){return n[b]&&a!=h.placeholder?a:null}).join("")});y.attr("readonly")||y.one("unmask",function(){y.unbind(".mask").removeData(b.mask.dataName)}).bind("focus.mask",function(){clearTimeout(c);var a;K=y.val();a=A();c=setTimeout(function(){z();a==d.length?y.caret(0,
a):y.caret(a)},10)}).bind("blur.mask",function(){A();y.val()!=K&&y.change()}).bind("keydown.mask",H).bind("keypress.mask",J).bind(a,function(){setTimeout(function(){var a=A(!0);y.caret(a);h.completed&&a==y.val().length&&h.completed.call(y)},0)});A()}))}})})(jQuery);
!function(b){function c(a){return ko.isObservable(a)&&void 0!==a.destroyAll}function a(a,c){this.options=this.mergeOptions(c);this.$select=b(a);this.originalOptions=this.$select.clone()[0].options;this.query="";this.searchTimeout=null;this.options.multiple="multiple"===this.$select.attr("multiple");this.options.onChange=b.proxy(this.options.onChange,this);this.options.onDropdownShow=b.proxy(this.options.onDropdownShow,this);this.options.onDropdownHide=b.proxy(this.options.onDropdownHide,this);this.buildContainer();
this.buildButton();this.buildSelectAll();this.buildDropdown();this.buildDropdownOptions();this.buildFilter();this.updateButtonText();this.updateSelectAll();this.$select.hide().after(this.$container)}"undefined"!==typeof ko&&ko.bindingHandlers&&!ko.bindingHandlers.multiselect&&(ko.bindingHandlers.multiselect={init:function(a,g,e,f,h){e=e().selectedOptions;g=ko.utils.unwrapObservable(g());b(a).multiselect(g);c(e)&&e.subscribe(function(c){var e=[],g=[];c.forEach(function(a){switch(a.status){case "added":e.push(a.value);
break;case "deleted":g.push(a.value)}});0<e.length&&b(a).multiselect("select",e);0<g.length&&b(a).multiselect("deselect",g)},null,"arrayChange")},update:function(a,g,e,f,h){e=e().options;f=b(a).data("multiselect");g=ko.utils.unwrapObservable(g());c(e)&&e.subscribe(function(c){b(a).multiselect("rebuild")});f?f.updateOriginalOptions():b(a).multiselect(g)}});a.prototype={defaults:{buttonText:function(a,c){if(0===a.length)return this.nonSelectedText+' <b class="caret"></b>';if(a.length>this.numberDisplayed)return a.length+
" "+this.nSelectedText+' <b class="caret"></b>';var e="";a.each(function(){var a=void 0!==b(this).attr("label")?b(this).attr("label"):b(this).html();e+=a+", "});return e.substr(0,e.length-2)+' <b class="caret"></b>'},buttonTitle:function(a,c){if(0===a.length)return this.nonSelectedText;var e="";a.each(function(){e+=b(this).text()+", "});return e.substr(0,e.length-2)},label:function(a){return b(a).attr("label")||b(a).html()},onChange:function(a,b){},onDropdownShow:function(a){},onDropdownHide:function(a){},
buttonClass:"btn btn-default",dropRight:!1,selectedClass:"active",buttonWidth:"auto",buttonContainer:'<div class="btn-group" />',maxHeight:!1,checkboxName:"multiselect",includeSelectAllOption:!1,includeSelectAllIfMoreThan:0,selectAllText:" Select all",selectAllValue:"multiselect-all",enableFiltering:!1,enableCaseInsensitiveFiltering:!1,filterPlaceholder:"Search",filterBehavior:"text",preventInputChangeEvent:!1,nonSelectedText:"None selected",nSelectedText:"selected",numberDisplayed:3,templates:{button:'<button type="button" class="multiselect dropdown-toggle" data-toggle="dropdown"></button>',
ul:'<ul class="multiselect-container dropdown-menu"></ul>',filter:'<div class="input-group"><span class="input-group-addon"><i class="glyphicon glyphicon-search"></i></span><input class="form-control multiselect-search" type="text"></div>',li:'<li><a href="javascript:void(0);"><label></label></a></li>',divider:'<li class="divider"></li>',liGroup:'<li><label class="multiselect-group"></label></li>'}},constructor:a,buildContainer:function(){this.$container=b(this.options.buttonContainer);this.$container.on("show.bs.dropdown",
this.options.onDropdownShow);this.$container.on("hide.bs.dropdown",this.options.onDropdownHide)},buildButton:function(){this.$button=b(this.options.templates.button).addClass(this.options.buttonClass);this.$select.prop("disabled")?this.disable():this.enable();this.options.buttonWidth&&"auto"!==this.options.buttonWidth&&this.$button.css({width:this.options.buttonWidth});var a=this.$select.attr("tabindex");a&&this.$button.attr("tabindex",a);this.$container.prepend(this.$button)},buildDropdown:function(){this.$ul=
b(this.options.templates.ul);this.options.dropRight&&this.$ul.addClass("pull-right");this.options.maxHeight&&this.$ul.css({"max-height":this.options.maxHeight+"px","overflow-y":"auto","overflow-x":"hidden"});this.$container.append(this.$ul)},buildDropdownOptions:function(){this.$select.children().each(b.proxy(function(a,c){var e=b(c).prop("tagName").toLowerCase();"optgroup"===e?this.createOptgroup(c):"option"===e&&("divider"===b(c).data("role")?this.createDivider():this.createOptionValue(c))},this));
b("li input",this.$ul).on("change",b.proxy(function(a){var c=b(a.target);a=c.prop("checked")||!1;var e=c.val()===this.options.selectAllValue;this.options.selectedClass&&(a?c.parents("li").addClass(this.options.selectedClass):c.parents("li").removeClass(this.options.selectedClass));var f=c.val(),f=this.getOptionByValue(f),h=b("option",this.$select).not(f),c=b("input",this.$container).not(c);if(e){for(var e=[],l=b('li input[value!="'+this.options.selectAllValue+'"][data-role!="divider"]',this.$ul).filter(":visible"),
k=0,n=l.length;k<n;k++)e.push(l[k].value);a?this.select(e):this.deselect(e)}a?(f.prop("selected",!0),this.options.multiple?f.prop("selected",!0):(this.options.selectedClass&&b(c).parents("li").removeClass(this.options.selectedClass),b(c).prop("checked",!1),h.prop("selected",!1),this.$button.click()),"active"===this.options.selectedClass&&h.parents("a").css("outline","")):f.prop("selected",!1);this.$select.change();this.options.onChange(f,a);this.updateButtonText();this.updateSelectAll();if(this.options.preventInputChangeEvent)return!1},
this));b("li a",this.$ul).on("touchstart click",function(a){a.stopPropagation();var c=b(a.target);if(a.shiftKey&&c.prop("checked")){a=c.parents("li:last").siblings('li[class="active"]:first');var e=c.parents("li").index(),f=a.index();e>f?c.parents("li:last").prevUntil(a).each(function(){b(this).find("input:first").prop("checked",!0).trigger("change")}):c.parents("li:last").nextUntil(a).each(function(){b(this).find("input:first").prop("checked",!0).trigger("change")})}c.blur()});this.$container.on("keydown",
b.proxy(function(a){if(!b('input[type="text"]',this.$container).is(":focus"))if(9!==a.keyCode&&27!==a.keyCode||!this.$container.hasClass("open")){var c=b(this.$container).find("li:not(.divider):visible a");if(c.length){var e=c.index(c.filter(":focus"));38===a.keyCode&&0<e?e--:40===a.keyCode&&e<c.length-1?e++:~e||(e=0);c=c.eq(e);c.focus();if(32===a.keyCode||13===a.keyCode)c=c.find("input"),c.prop("checked",!c.prop("checked")),c.change();a.stopPropagation();a.preventDefault()}}else this.$button.click()},
this))},createOptionValue:function(a){b(a).is(":selected")&&b(a).prop("selected",!0);var c=this.options.label(a),e=b(a).val(),f=this.options.multiple?"checkbox":"radio",h=b(this.options.templates.li);b("label",h).addClass(f);b("label",h).append('<input type="'+f+'" name="'+this.options.checkboxName+'" />');var f=b(a).prop("selected")||!1,l=b("input",h);l.val(e);e===this.options.selectAllValue&&l.parent().parent().addClass("multiselect-all");b("label",h).append(" "+c);this.$ul.append(h);b(a).is(":disabled")&&
l.attr("disabled","disabled").prop("disabled",!0).parents("li").addClass("disabled");l.prop("checked",f);f&&this.options.selectedClass&&l.parents("li").addClass(this.options.selectedClass)},createDivider:function(a){a=b(this.options.templates.divider);this.$ul.append(a)},createOptgroup:function(a){var c=b(a).prop("label"),e=b(this.options.templates.liGroup);b("label",e).text(c);this.$ul.append(e);b(a).is(":disabled")&&e.addClass("disabled");b("option",a).each(b.proxy(function(a,b){this.createOptionValue(b)},
this))},buildSelectAll:function(){!this.hasSelectAll()&&this.options.includeSelectAllOption&&this.options.multiple&&b('option[data-role!="divider"]',this.$select).length>this.options.includeSelectAllIfMoreThan&&(this.options.includeSelectAllDivider&&this.$select.prepend('<option value="" disabled="disabled" data-role="divider">'),this.$select.prepend('<option value="'+this.options.selectAllValue+'">'+this.options.selectAllText+"</option>"))},buildFilter:function(){if(this.options.enableFiltering||
this.options.enableCaseInsensitiveFiltering){var a=Math.max(this.options.enableFiltering,this.options.enableCaseInsensitiveFiltering);this.$select.find("option").length>=a&&(this.$filter=b(this.options.templates.filter),b("input",this.$filter).attr("placeholder",this.options.filterPlaceholder),this.$ul.prepend(this.$filter),this.$filter.val(this.query).on("click",function(a){a.stopPropagation()}).on("input keydown",b.proxy(function(a){clearTimeout(this.searchTimeout);this.searchTimeout=this.asyncFunction(b.proxy(function(){this.query!==
a.target.value&&(this.query=a.target.value,b.each(b("li",this.$ul),b.proxy(function(a,c){var d=b("input",c).val(),g=b("label",c).text(),k="";"text"===this.options.filterBehavior?k=g:"value"===this.options.filterBehavior?k=d:"both"===this.options.filterBehavior&&(k=g+"\n"+d);d!==this.options.selectAllValue&&g&&(d=!1,this.options.enableCaseInsensitiveFiltering&&-1<k.toLowerCase().indexOf(this.query.toLowerCase())?d=!0:-1<k.indexOf(this.query)&&(d=!0),d?b(c).show():b(c).hide())},this)))},this),300,this)},
this)))}},destroy:function(){this.$container.remove();this.$select.show();this.$select.data("multiselect",null)},refresh:function(){b("option",this.$select).each(b.proxy(function(a,c){var e=b("li input",this.$ul).filter(function(){return b(this).val()===b(c).val()});b(c).is(":selected")?(e.prop("checked",!0),this.options.selectedClass&&e.parents("li").addClass(this.options.selectedClass)):(e.prop("checked",!1),this.options.selectedClass&&e.parents("li").removeClass(this.options.selectedClass));b(c).is(":disabled")?
e.attr("disabled","disabled").prop("disabled",!0).parents("li").addClass("disabled"):e.prop("disabled",!1).parents("li").removeClass("disabled")},this));this.updateButtonText();this.updateSelectAll()},select:function(a){b.isArray(a)||(a=[a]);for(var c=0;c<a.length;c++){var e=a[c],f=this.getOptionByValue(e),e=this.getInputByValue(e);this.options.selectedClass&&e.parents("li").addClass(this.options.selectedClass);e.prop("checked",!0);f.prop("selected",!0)}this.updateButtonText()},clearSelection:function(){var a=
this.getSelected();if(a.length){for(var b=[],c=0;c<a.length;c+=1)b.push(a[c].value);this.deselect(b);this.$select.change()}},deselect:function(a){b.isArray(a)||(a=[a]);for(var c=0;c<a.length;c++){var e=a[c],f=this.getOptionByValue(e),e=this.getInputByValue(e);this.options.selectedClass&&e.parents("li").removeClass(this.options.selectedClass);e.prop("checked",!1);f.prop("selected",!1)}this.updateButtonText()},rebuild:function(){this.$ul.html("");b('option[value="'+this.options.selectAllValue+'"]',
this.$select).remove();this.options.multiple="multiple"===this.$select.attr("multiple");this.buildSelectAll();this.buildDropdownOptions();this.buildFilter();this.updateButtonText();this.updateSelectAll()},dataprovider:function(a){var b="";a.forEach(function(a){b+='<option value="'+a.value+'">'+a.label+"</option>"});this.$select.html(b);this.rebuild()},enable:function(){this.$select.prop("disabled",!1);this.$button.prop("disabled",!1).removeClass("disabled")},disable:function(){this.$select.prop("disabled",
!0);this.$button.prop("disabled",!0).addClass("disabled")},setOptions:function(a){this.options=this.mergeOptions(a)},mergeOptions:function(a){return b.extend(!0,{},this.defaults,a)},hasSelectAll:function(){return 0<b('option[value="'+this.options.selectAllValue+'"]',this.$select).length},updateSelectAll:function(){this.hasSelectAll()&&(this.getSelected().length===b("option:not([data-role=divider])",this.$select).length-1?this.select(this.options.selectAllValue):this.deselect(this.options.selectAllValue))},
updateButtonText:function(){var a=this.getSelected();b("button",this.$container).html(this.options.buttonText(a,this.$select));b("button",this.$container).attr("title",this.options.buttonTitle(a,this.$select))},getSelected:function(){return b('option[value!="'+this.options.selectAllValue+'"]:selected',this.$select).filter(function(){return b(this).prop("selected")})},getOptionByValue:function(a){var c=b("option",this.$select);a=a.toString();for(var e=0;e<c.length;e+=1){var f=c[e];if(f.value===a)return b(f)}},
getInputByValue:function(a){var c=b("li input",this.$ul);a=a.toString();for(var e=0;e<c.length;e+=1){var f=c[e];if(f.value===a)return b(f)}},updateOriginalOptions:function(){this.originalOptions=this.$select.clone()[0].options},asyncFunction:function(a,b,c){var f=Array.prototype.slice.call(arguments,3);return setTimeout(function(){a.apply(c||window,f)},b)}};b.fn.multiselect=function(c,g){return this.each(function(){var e=b(this).data("multiselect"),f="object"===typeof c&&c;e||(e=new a(this,f),b(this).data("multiselect",
e));"string"===typeof c&&(e[c](g),"destroy"===c&&b(this).data("multiselect",!1))})};b.fn.multiselect.Constructor=a;b(function(){b("select[data-role=multiselect]").multiselect()})}(window.jQuery);
(function(b){jQuery.fn.extend({slimScroll:function(c){var a=b.extend({width:"auto",height:"250px",size:"7px",color:"#000",position:"right",distance:"1px",start:"top",opacity:.4,alwaysVisible:!1,disableFadeOut:!1,railVisible:!1,railColor:"#333",railOpacity:.2,railDraggable:!0,railClass:"slimScrollRail",barClass:"slimScrollBar",wrapperClass:"slimScrollDiv",allowPageScroll:!1,wheelStep:20,touchScrollStep:200,borderRadius:"7px",railBorderRadius:"7px"},c);this.each(function(){function d(c){if(k){c=c||
window.event;var d=0;c.wheelDelta&&(d=-c.wheelDelta/120);c.detail&&(d=c.detail/3);b(c.target||c.srcTarget||c.srcElement).closest("."+a.wrapperClass).is(z.parent())&&g(d,!0);c.preventDefault&&!L&&c.preventDefault();L||(c.returnValue=!1)}}function g(b,c,d){L=!1;var e=b,f=z.outerHeight()-y.outerHeight();c&&(e=parseInt(y.css("top"))+b*parseInt(a.wheelStep)/100*y.outerHeight(),e=Math.min(Math.max(e,0),f),e=0<b?Math.ceil(e):Math.floor(e),y.css({top:e+"px"}));D=parseInt(y.css("top"))/(z.outerHeight()-y.outerHeight());
e=D*(z[0].scrollHeight-z.outerHeight());d&&(e=b,b=e/z[0].scrollHeight*z.outerHeight(),b=Math.min(Math.max(b,0),f),y.css({top:b+"px"}));z.scrollTop(e);z.trigger("slimscrolling",~~e);h();l()}function e(){window.addEventListener?(this.addEventListener("DOMMouseScroll",d,!1),this.addEventListener("mousewheel",d,!1),this.addEventListener("MozMousePixelScroll",d,!1)):document.attachEvent("onmousewheel",d)}function f(){q=Math.max(z.outerHeight()/z[0].scrollHeight*z.outerHeight(),J);y.css({height:q+"px"});
var a=q==z.outerHeight()?"none":"block";y.css({display:a})}function h(){f();clearTimeout(m);D==~~D?(L=a.allowPageScroll,H!=D&&z.trigger("slimscroll",0==~~D?"top":"bottom")):L=!1;H=D;q>=z.outerHeight()?L=!0:(y.stop(!0,!0).fadeIn("fast"),a.railVisible&&G.stop(!0,!0).fadeIn("fast"))}function l(){a.alwaysVisible||(m=setTimeout(function(){a.disableFadeOut&&k||n||x||(y.fadeOut("slow"),G.fadeOut("slow"))},1E3))}var k,n,x,m,p,q,D,H,J=30,L=!1,z=b(this);if(z.parent().hasClass(a.wrapperClass)){var A=z.scrollTop(),
y=z.parent().find("."+a.barClass),G=z.parent().find("."+a.railClass);f();if(b.isPlainObject(c)){if("height"in c&&"auto"==c.height){z.parent().css("height","auto");z.css("height","auto");var K=z.parent().parent().height();z.parent().css("height",K);z.css("height",K)}if("scrollTo"in c)A=parseInt(a.scrollTo);else if("scrollBy"in c)A+=parseInt(a.scrollBy);else if("destroy"in c){y.remove();G.remove();z.unwrap();return}g(A,!1,!0)}}else a.height="auto"==a.height?z.parent().height():a.height,A=b("<div></div>").addClass(a.wrapperClass).css({position:"relative",
overflow:"hidden",width:a.width,height:a.height}),z.css({overflow:"hidden",width:a.width,height:a.height}),G=b("<div></div>").addClass(a.railClass).css({width:a.size,height:"100%",position:"absolute",top:0,display:a.alwaysVisible&&a.railVisible?"block":"none","border-radius":a.railBorderRadius,background:a.railColor,opacity:a.railOpacity,zIndex:90}),y=b("<div></div>").addClass(a.barClass).css({background:a.color,width:a.size,position:"absolute",top:0,opacity:a.opacity,display:a.alwaysVisible?"block":
"none","border-radius":a.borderRadius,BorderRadius:a.borderRadius,MozBorderRadius:a.borderRadius,WebkitBorderRadius:a.borderRadius,zIndex:99}),K="right"==a.position?{right:a.distance}:{left:a.distance},G.css(K),y.css(K),z.wrap(A),z.parent().append(y),z.parent().append(G),a.railDraggable&&y.bind("mousedown",function(a){var c=b(document);x=!0;t=parseFloat(y.css("top"));pageY=a.pageY;c.bind("mousemove.slimscroll",function(a){currTop=t+a.pageY-pageY;y.css("top",currTop);g(0,y.position().top,!1)});c.bind("mouseup.slimscroll",
function(a){x=!1;l();c.unbind(".slimscroll")});return!1}).bind("selectstart.slimscroll",function(a){a.stopPropagation();a.preventDefault();return!1}),G.hover(function(){h()},function(){l()}),y.hover(function(){n=!0},function(){n=!1}),z.hover(function(){k=!0;h();l()},function(){k=!1;l()}),z.bind("touchstart",function(a,b){a.originalEvent.touches.length&&(p=a.originalEvent.touches[0].pageY)}),z.bind("touchmove",function(b){L||b.originalEvent.preventDefault();b.originalEvent.touches.length&&(g((p-b.originalEvent.touches[0].pageY)/
a.touchScrollStep,!0),p=b.originalEvent.touches[0].pageY)}),f(),"bottom"===a.start?(y.css({top:z.outerHeight()-y.outerHeight()}),g(0,!0)):"top"!==a.start&&(g(b(a.start).position().top,null,!0),a.alwaysVisible||y.hide()),e()});return this}});jQuery.fn.extend({slimscroll:jQuery.fn.slimScroll})})(jQuery);